feat(appstash): add multi-target context support#64
Merged
pyramation merged 1 commit intomainfrom Feb 17, 2026
Merged
Conversation
- Add ContextTargetEndpoint interface - Add optional targets field to ContextConfig - Add getTargetEndpoint() method to ConfigStore - createContext() accepts optional targets map - getTargetEndpoint() resolves: target-specific endpoint → fallback to main endpoint - Fully backward compatible with single-target contexts - 8 new tests for multi-target functionality
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(appstash): add multi-target context support
Summary
Extends
ContextConfigwith an optionaltargetsmap so a single context can store per-API endpoint overrides (e.g.,auth,members,appeach pointing to different GraphQL endpoints). AddsgetTargetEndpoint(targetName, contextName?)to resolve the correct endpoint for a given target, falling back to the context's mainendpointwhen no target-specific override exists.This is a prerequisite for unified multi-target CLI generation in
@constructive-io/graphql-codegen, where a single codegen config can define multiple API endpoints that share one set of credentials.New types:
ContextTargetEndpoint—{ endpoint: string }(extensible for future per-target config)Changed types:
ContextConfig.targets?— optionalRecord<string, ContextTargetEndpoint>ConfigStore.createContext()— accepts optionaltargetsin optionsConfigStore.getTargetEndpoint()— new methodFully backward compatible — existing single-endpoint contexts work identically.
Review & Testing Checklist for Human
getTargetEndpoint: When a target name is not found inctx.targets, it silently falls back toctx.endpointrather than returningnull. Verify this is the desired behavior — a misspelled target name in a multi-target context would silently route to the wrong endpoint. Consider whether this should be configurable or at least log a warning.pnpm testinpackages/appstashto confirm all 54 tests pass (46 existing + 8 new).Notes