graphql-mesh icon indicating copy to clipboard operation
graphql-mesh copied to clipboard

Mesh-serve in production

Open stephen-barrow opened this issue 1 year ago • 1 comments

Hi,

Is it still possible to have programmatic resolvers like in v0 in order to do batching with objects as args ie

           argsFromKeys(keys) {
            return {
              input: keys.map((key: any) => ({
                id: key.bookId,
                type: key.type,
                amount: key.rate,
              
              })),
            };
          },
          key: {
            bookId: root.id,
            amount: root.price,
            type: root.category?.type,
        
          },
If not how would I achieve the equivalent in v1

stephen-barrow avatar Sep 17 '24 06:09 stephen-barrow

@ardatan Turns out instead of using npx hive-gateway supergraph i could use npx mesh-serve supergraph. Now all my resolvers work when added to additionalResolvers in the gateway config. It would be good to know what the difference is and if you can use this in production as this is not documented anywhere?

stephen-barrow avatar Sep 17 '24 07:09 stephen-barrow

The additionalResolvers should work in the Hive Gateway,see documentation. There's even E2E tests ensuring it works (like here and here). Is it still not working for you using the latest? If so, can you ideally provide a repro or at least the config file?

enisdenjo avatar Oct 28 '24 17:10 enisdenjo

Closing the issue for now. Let us know if you still have any questions or issues. We can always reopen it!

ardatan avatar Nov 06 '24 13:11 ardatan