Git Product home page Git Product logo

Comments (7)

rmosolgo avatar rmosolgo commented on June 27, 2024

Thanks, I think graphql-ruby is missing quirks_mode: true somewhere!

from graphiql-rails.

rmosolgo avatar rmosolgo commented on June 27, 2024

I think this is fixed by rmosolgo/graphql-ruby#316 , can you try master branch?

from graphiql-rails.

jcmfernandes avatar jcmfernandes commented on June 27, 2024

Since graphql-ruby is heavy on JSON generation for obvious reasons, wouldn't it be cool to allow it to use other JSON serializers like Oj?

If it doesn't sound like a bad idea right away, I may give this a try and post some benchmarks soon 😉 what do you say @rmosolgo?

from graphiql-rails.

rmosolgo avatar rmosolgo commented on June 27, 2024

heavy on JSON generation

I don't think of it as heavy on JSON generation. There are only a few places where we stringify Ruby values with JSON:

  • error messages
  • argument default values in the introspection result (which is where this particular bug happened)

In general, graphql-ruby returns a Hash to the user, and the user can serialize it however they want!

I don't expect a big difference in the benchmark, since JSON is used so sparingly in the gem itself, but you're welcome to give it a try. If it turns out to be a big improvement, I'm happy to look at supporting other JSON implementations!

from graphiql-rails.

jcmfernandes avatar jcmfernandes commented on June 27, 2024

You, unexpectedly, seem mostly right 😉 somehow I was expecting more JSON magic to happen inside, but seems like the bulk of the work is indeed outside, in serializing the response.

from graphiql-rails.

jackalcooper avatar jackalcooper commented on June 27, 2024

Hi, guys. It is not a pain to me now. Well it could be just for now.

Here is my dirty walk around:

module JSON
  def self.dump(raw)
    raw.to_json
  end
end

from graphiql-rails.

rmosolgo avatar rmosolgo commented on June 27, 2024

Glad you found something that works for you! I hope those changes to JSON will fix this bug for others, too.

from graphiql-rails.

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.