Open Jinnified opened 6 years ago
It seems you may be missing:
engine.listen({
port: 3000,
expressApp: app,
});
See https://www.apollographql.com/docs/engine/setup-node.html#apollo-engine
Hi @martijnwalraven what about a example using apolloServer 2.0. Im trying but when a consume you have to specify in the client the header of cache control (is mandatory that?).
Hi
I am trying to implement cacheControl following this guide: https://www.apollographql.com/docs/engine/caching.html
I have one single huge REST api which spits out about 1000 fields for each request. and i have added a layer of graphql in my Express server on top of this REST endpoint, with a resolver return a promise.
I have broken down all the fields into about 40 schema files, and on each schema i have added a cachecontrol annotation, like so:
and I am using apollo-server-express and apollo-engine for the graphql server setup, like so:
versions: apollo-server-express: 1.3.4 apollo-engine: 1.0.4 express:4.15.2
then when i tested it, i expect my resolver (which will make the HTTP call to that huge REST endpoint) should only gets run ONCE every 240 seconds, but what actually happened is that resolver gets called every time a graphql query gets run regardless, doesn't look like the cache is working, or did i miss anything?