ardatan / graphql-mesh

🕸️ GraphQL Federation Framework for any API services such as REST, OpenAPI, Swagger, SOAP, gRPC and more...
https://the-guild.dev/graphql/mesh
MIT License
3.29k stars 345 forks source link

Resolvers composition not working as described in the docs #4588

Open gtuk opened 2 years ago

gtuk commented 2 years ago

Issue workflow progress

Progress of the issue based on the Contributor Workflow

Make sure to fork this template and run yarn generate in the terminal.

Please make sure Mesh package versions under package.json matches yours.


Describe the bug

If i try to use resolversComposition it is not working as expected and my console.log inside the composer is not called.

To Reproduce Steps to reproduce the behavior:

git clone git@github.com:gtuk/graphql-mesh-resolvers-composition-sample-repo.git
cd graphql-mesh-resolvers-composition-sample-repo.git
yarn dev

Run any query e.g query {capsules {id}} Expected behavior

If i call any query e.g query {capsules {id}} is not showing the console log from the src/add-fields composer

Environment:

ardatan commented 2 years ago

Resolvers Composition doesn't work with GraphQL handler because the gateway forwards the request to the source without applying a resolution logic.

gtuk commented 2 years ago

Thanks or the info. Seem i missed it completely or the docs don't mentioned it. Is there anything similar that i can use instead when the handler is graphql?