Implementing Runtime Introspection #3419
Unanswered
Undistraction
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have just updated our API to include Union types and this has caused issues with graphcache. These issues are resolved by supplying graphcache with a schema.
Unfortunately our API is behind auth and for security reasons we cannot expose the schema to a user that isn't authenticated, so this means doing a dev-time introspection query and including it in the source via an import isn't an option. Neither is removing Union types from the API.
This leaves us only one option that I can see which is to execute the introspection query at runtime. This isn't ideal as it means an additional round-trip to the server, and the bulk of a large schema, but it seems like something we are going to have to do.
This presents us with a chicken and egg situation where we want to use URQL to make the request, using the auth flow provided by the Auth exchange, but we can't use URQL until we make the request because the schema is part of configuration needed to create the provider, which is in turn necessary to use URQL.
I don't want to have to use different tooling for the initial schema request, including re-implementing auth to allow it to to be an authenticated query but I don't see another option. In an ideal world this would be taken care of by the graphcache exchange, but that isn't currently supported. Any suggestions would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions