mercurius-js / cache

Adds an in-process caching layer to Mercurius. Federation is fully supported.
MIT License
106 stars 19 forks source link

not working with fastify-cli project. #124

Closed vamshi9666 closed 1 year ago

vamshi9666 commented 1 year ago

I have a project setup using fastify-cli and bob-ts for typescript.

Mercurius cache is not getting registered when running project in dev/prod mode. But when i ran fastify-fli export command and run generated server.js. Cache is working as expected.

I put some console.log's in lib code and found out 'onReady' hook is never being called. Possible issue with cli itself

library code cache.js ` app.log.warn('mercurius-cache is ready')

app.addHook('onReady', async () => { app.log.warn('mercurius-cache is loaded');

app.graphql.cache.refresh()
report.refresh()

})

`

mcollina commented 1 year ago

Thanks for reporting!

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.

vamshi9666 commented 1 year ago

unable to reproduce. This issue can be closed.