Giter VIP home page Giter VIP logo

graphoid's Introduction

graphoid

Build Status Gem Version Maintainability Test Coverage

Generates a full GraphQL API using introspection of Mongoid or ActiveRecord models.

API Dodocumentation

The API Documentation that displays how to use the queries and mutations that Graphoid automatically generates.

Dependency

This gem depends on the GraphQL gem. Please install that gem first before continuing

Installation

Add this line to your Gemfile:

gem 'graphoid'
$ bundle install

Database

Create the file config/initializers/graphoid.rb And configure the database you want to use in it (:mongoid or :active_record)

Graphoid.configure do |config|
  config.driver = :mongoid
end

Usage

You can determine which models will be visible in the API by including the Graphoid Queries and Mutations concerns

class Person
  include Graphoid::Queries
  include Graphoid::Mutations
end

Examples

You can find an example that uses ActiveRecord in the Tester AR folder
And an example with Mongoid in the Tester Mongo folder
In this same repository.

Contributing

  • Live Reload
  • Aggregations
  • Permissions on fields
  • Relation with aliases tests
  • Write division for "every" in Mongoid and AR
  • Sort top level models by association values
  • Filter by Array or Hash.
  • has_one_through implementation
  • has_many_selves tests
  • has_and_belongs_to_many_selves tests
  • Embedded::Many filtering implementation
  • Embedded::One filtering with OR/AND

Testing

$ DRIVER=ar DEBUG=true bundle exec rspec
$ DRIVER=mongo DEBUG=true bundle exec rspec

Thank You !!

Ryan Yeske for the whole idea and for validating that metaprogramming this was possible.

Andres Rafael for working so hard on connecting the gem on the frontend and finding its failures.

License

The gem is available as open source under the terms of the MIT License.

graphoid's People

Contributors

dependabot[bot] avatar maxcoto avatar

Watchers

 avatar

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.