I am currently learning and testing around with GraphQL. Richt now I am building a layer between the actual graphql-endpoint and an imaginary frontend (for example a storefront).
Here what I did up to this point (this is all tested and working):
- Get schema from the actual endpoint (introspection query…).
- Build a “proxy” resolver that sends the requests that are made to the layer to the actual graphql-endpoint & build a executable schema using wrapSchema() from graphql-tools/wrap:
const schema = wrapSchema({
schema: serverSchema,
executor,
createProxyingResolver: applicationProxyResolver,
});
- And here I am stuck: Now I want to filter out one query and change where the request is sent to. (basically sending the request to another endpoint)
In all examples I looked into they just change it in the schema, but I can’t/don’t want to do that as exactly that is what I want to avoid doing. I want to change the schema in my layer, not the original one on the actual graphql-endpoint.
Any ideas as to how i can tackle that issue?
