Coder Social home page Coder Social logo

Comments (7)

ro-savage avatar ro-savage commented on August 22, 2024 1

Thanks @exAspArk - came across the today and updating all our resolvers to use BatchLoader::GraphQL.for fixed it.

from batch-loader.

exAspArk avatar exAspArk commented on August 22, 2024

Hey @JanStevens!

Thank you for sharing the link. I'll be able to take a look into it once the Interpreter became a default runtime and became more stable (not experimental to avoid potential breaking changes in BatchLoader).

from batch-loader.

 avatar commented on August 22, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

from batch-loader.

bessey avatar bessey commented on August 22, 2024

@exAspArk, does this work now? I mean, we're just starting to use this gem on a grapqhl-ruby 1.9 project and it seems to work, but thought i'd confirm since I see nothing in the changelogs.

from batch-loader.

exAspArk avatar exAspArk commented on August 22, 2024

It seems like GraphQL::Execution::Interpreter is now considered stable since graphql gem version 1.10+ (January 2020). I'm reopening the issue, will try to make it work 🙏

from batch-loader.

exAspArk avatar exAspArk commented on August 22, 2024

@exAspArk, does this work now? I mean, we're just starting to use this gem on a grapqhl-ruby 1.9 project and it seems to work, but thought i'd confirm since I see nothing in the changelogs.

Long story short:

  • if you use BatchLoader::GraphQL.for, then you're fine 👍
  • if you use BatchLoader.for and Interpreter, then you'd need to use #62 (draft PR)
  • if you use BatchLoader.for without Interpreter, then it works with all GraphQL versions except the range between 1.8.7 rmosolgo/graphql-ruby#1778 - 1.8.10 #26 (comment)

I.e. please use BatchLoader::GraphQL.for

I'm going to deprecate using BatchLoader.for in GraphQL, which adds unnecessary coupling with the graphql gem. Alternatively, it's possible to keep BatchLoader.for and wrap it:

field :user, UserType, null: false

def user # resolver
  BatchLoader::GraphQL.wrap(lazy_user)
end

def lazy_user
  BatchLoader.for...
end

from batch-loader.

exAspArk avatar exAspArk commented on August 22, 2024

I released a new version which still keeps compatibility with BatchLoader.for + GraphQL with Interpreter, but adds a deprecation warning. More info in the changelog.

from batch-loader.

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.