Giter Club home page Giter Club logo

Comments (3)

DmitryTsepelev avatar DmitryTsepelev commented on September 26, 2024

Hey @jeromedalbert, could you please try to use then? Something like resolved.then { |value| ... }

from graphql-ruby-fragment_cache.

jeromedalbert avatar jeromedalbert commented on September 26, 2024

No luck with that, it returns a GraphQL::Execution::Lazy too

from graphql-ruby-fragment_cache.

jeromedalbert avatar jeromedalbert commented on September 26, 2024

I think the root cause of the problem is that my resolve helper code does not define any query in GraphQL::Query.new. That is why I am getting errors about a nil operation_type, since no operation (query or mutation or subscription) is defined.

Just for the heck of it I passed a placeholder query GraphQL::Query.new(MyAppSchema, 'query { posts { title } }', context: context) and did resolved.value, but that gives me the following:

NoMethodError: undefined method `map' for nil:NilClass
from /Users/jerome/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/graphql-fragment_cache-1.13.1/lib/graphql/fragment_cache/cache_key_builder.rb:177:in `bl
ock in path_cache_key'

because the CacheKeyBuilder path is nil. It makes sense since I am trying to shoehorn a query that is not being executed the normal way.

graphql-ruby-fragment_cache needs a path to compute its cache key, but my resolve helper code never provides one. As is, the helper code is incompatible with the gem. It might be possible to make it work by making the helper "backfill" a query from the field name, and there would still be this nil path issue to figure out. But I think it is overkill and the simplest solution is probably to disable cache processing with #90.

from graphql-ruby-fragment_cache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.