Repository navigation
feat: support plain GraphQL introspection - #87
Merged
Merged
Conversation
The introspection query assumed Dagger's GraphQL extensions, which expose directive applications on fields, enum values, and input values via a _DirectiveApplication type. Plain spec-compliant endpoints like GitHub's reject those selections, so any non-Dagger import failed to introspect. Split the query in two: introspection.graphql is now the spec-compliant default, and introspection_dagger.graphql carries the Dagger extensions. introspectSchema takes a dagger flag to pick between them, threaded through each call site from the import's Dagger setting. Also rename the github demo's loop binding from node to issue so it does not collide with the root node field when Dagger is auto-imported alongside. Signed-off-by: Alex Suraci <[email protected]>
Deploying dang with
|
| Latest commit: |
ca1451e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bd5628fa.dang-3kk.pages.dev |
| Branch Preview URL: | https://plain-graphql-introspection.dang-3kk.pages.dev |
TestExpectedTypeDirectivesFromIntrospection relies on the test server's extended introspection to surface applied @expectedType directives. Now that introspection defaults to the spec-compliant query, the import must opt into the Dagger query by setting Dagger: true on its ImportConfig. Signed-off-by: Alex Suraci <[email protected]>
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.
Problem
Dang's introspection query assumed Dagger's GraphQL extensions —
directivesselections on__Field,__EnumValue, and__InputValue, plus the_DirectiveApplicationtype. Plain spec-compliant endpoints like GitHub's reject those fields, so any non-Dagger import failed during introspection:Changes
introspection.graphqlis now the spec-compliant default, andintrospection_dagger.graphqlcarries the Dagger directive extensions (embedded asQueryandDaggerQuery).introspectSchema/IntrospectSchematake adagger boolto pick between them, threaded through each call site from the import'sDaggersetting. Dagger module/session paths passtrue; endpoint imports passsource.Dagger.node→issueso it doesn't collide with the rootnodefield when Dagger is auto-imported alongside (which happens when running the demo from inside this repo, itself a Dagger module).Testing
GITHUB_TOKEN=$(gh auth token) go run ./cmd/dang ./demos/githubnow introspects GitHub and runs the full demo (repo stats, issues, union-type search). Existingpkg/dangtests pass.