Closed acmoune closed 6 years ago
Note that when I remove my query resolvers, things seems to work, but I need to do such queries:
{
quote {
item(id: "xxxx") { title price quantity }
}
}
So I need a Query resolver.
@peggyrayzis Please can you have a look
I think the problem is that the defaults
provided to stateLink
constructor don't initial the ROOT_QUERY
in the cache.
I understand now that Query resolvers
are only called on cache miss, so I should just return defaults state in my resolver.
In case I provide this initializer resolver, what about the defaults values provided to the stateLink constructor ?
Is it possible to call writeQuery within that resolver ? hoping that writeQuery will update the cache ROOT_QUERY, because writeCache (called for the defaults) is not updating the cache ROOT_QUERY.
It is like I am crazy talking to myself, I am closing this. If somebody has a look at this one day and want to share something, that will be cool.
I know my question belongs to stackoverflow, but I am not having a response, so ...
In the doc, there are example of Mutation resolvers, but none of Query resolvers, and I don't know how to make mine to work.
I create my state link with defaults values, something like this:
So my cache should not be empty. Now my
resolvers
map looks like this:The
datasource
of myresolvers
is the cache right ? so I have to query the cache somehow. But this is not working, I guess it is because I am trying to respond toquote
query, and for that I am making anotherquote
query.I think I should get the
quote
data without querying forquote
, but how ?I am getting this error:
Please help