Closed delkopiso closed 2 years ago
@delkopiso currently, we safe list particular well-known introspection queries, like the one provided by graphql-js
and those sent by tooling and editors.
We're absolutely happy to add this query to the list, but just out of curiosity, is that an introspection query that you just often run yourself? Or is it from a particular tool? A little more information would just be education in how we think about this. Thanks!
@abernix the safe listing makes sense. And yes, that's just an introspection I run for sanity checks when things go wrong.
The issue I began with was that @graphql-codegen/cli
was failing to generate types when pointed to the managed supergraph. I was getting the following error:
Value retrieval failed: Empty query plan. This often means an unhandled Introspection query was sent. Please file an issue to apollographql/router.
So your response makes that error message make more sense.
According to @graphql-codegen/cli
's docs they are using the introspection query provided by graphql-js
. And switching from using rotuer to gateway fixes my underlying problem, so I still think there's an existing issue with instrospection resolution in router. Let me see if I can produce a small reproduction repo.
@delkopiso There are slight variations in some versions, including variations in spacing. We currently do exact matching with no normalization (#43, maybe). That's to say, if you can capture the exact query that @graphql-codegen/cli
is sending, we'll happily add that!
@abernix I created a repo demonstrating the difference in expected behavior: https://github.com/delkopiso/apollo-router-introspection-test.
I went through the logs to grab the introspection queries both servers received:
Hopefully this helps
Thank you so much for the reproduction! I see two potential solutions the Router team may take here:
Describe the bug Introspection query fails with a managed federated supergraph.
To Reproduce Steps to reproduce the behavior:
input RegisterInput { name: String! email: String! password: String! }
input LoginInput { username: String! password: String! }
type Mutation { login(input: LoginInput!): String! register(input: RegisterInput!): Boolean! }
type Query { me: User! }
Expected behavior The same output as querying the subgraph directly:
Output Apollo Router logs:
Desktop (please complete the following information): Docker for Mac running on MacOS Monterrey 12.2.1 Apollo Router v0.1.0-alpha.8