Giter Site home page Giter Site logo

truecar / graphql-decorate Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 6.0 113 KB

Easily decorate graphql-ruby types with a flexible API

Home Page: http://truecar.github.io/graphql-decorate

License: MIT License

Ruby 99.67% Shell 0.33%
decorator-pattern graphql ruby

graphql-decorate's People

Contributors

benfalk avatar benrbrook avatar dwillett avatar jacobmoretti avatar jakimtc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphql-decorate's Issues

Fix decoration being applied before connection pagination.

Decoration seems to happen before any pagination from the built in connections. This results in more objects being processed than are actually returned. The most likely cause is adding the decoration extension before all other extensions by pushing it to the beginning of the list.

Some autoloading strategies can leave type classes without desired decorator attributes

When a type implements an interface that eventually connects back to the same type in the graph, the type class given to the field may not contain the proper decorator attributes as that class has not been fully initialized. This was observed in a Rails 6 app with zeitwerk. In production environments where everything is loaded upfront this is not an issue.

A workaround for now is to specify the types for fields as strings instead of the class itself. field :rectangle, Rectangle vs field :rectangle, 'Rectangle'. You can also just ensure that the decorate_with and decorator_metadata methods are defined first in your type files.

Broken in graphql-ruby 1.13+

Legacy .to_graphqlobjects are deprecated and will be removed in GraphQL-Ruby 2.0. Remove.to_graphql to use a class-based definition instead.

This gem no longer works :(

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.