You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can now group together a bunch of disparate FieldTypeObjectTypes under a FieldItem abstract type, vastly simplifying our implementation and querying interface
The approach I'm taking tonight (which should hopefully work) is to dynamically define Fields for allContentTypes in the entire system, then whitelist access per-user by following this guide's recommendations: http://graphql-ruby.org/schema/limiting_visibility.html
For a truly clean query interface (dynamic, per-user schemas and fields that don't rely on field hiding), we need to wait for the GraphQL-Ruby author to merge rmosolgo/graphql-ruby#1037. This is almost a complete rewrite of the library that will allow us to pass arguments into an ObjectType definition. Until then, we'll have to make do with a query interface that's a bit more verbose, and is not self-documenting in all places.
Activity
toastercup commentedon Oct 25, 2017
Client-side Resources:
[-]GraphQL[/-][+]GraphQL + ElasticSearch[/+]toastercup commentedon Nov 7, 2017
Particularly relevant; an ElasticSearch query builder DSL: https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-dsl
toastercup commentedon Nov 8, 2017
graphql-rubyalso has its own JS client: http://graphql-ruby.org/javascript_client/overview.htmlIt also supports subscriptions with Apollo Client: http://graphql-ruby.org/javascript_client/apollo_subscriptions.html
toastercup commentedon Nov 8, 2017
This is what I've been loosely following for dynamically generating the schema for FieldItems: http://graphql-ruby.org/schema/dynamic_schema.html
toastercup commentedon Nov 8, 2017
We'll be using Rails's built-in API key functionality to authenticate API users: http://api.rubyonrails.org/classes/ActiveRecord/SecureToken/ClassMethods.html
toastercup commentedon Nov 8, 2017
Good rundown of GraphQL Query core concepts with proper terminology: https://dev-blog.apollodata.com/the-anatomy-of-a-graphql-query-6dffa9e9e747
toastercup commentedon Nov 8, 2017
This will yield a huge benefit over how I was doing things: http://graphql-ruby.org/types/abstract_types.html
We can now group together a bunch of disparate
FieldTypeObjectTypesunder aFieldItemabstract type, vastly simplifying our implementation and querying interfacetoastercup commentedon Nov 8, 2017
And an invaluable explanation of Interfaces and Unions: https://medium.com/the-graphqlhub/graphql-tour-interfaces-and-unions-7dd5be35de0d
toastercup commentedon Nov 9, 2017
The approach I'm taking tonight (which should hopefully work) is to dynamically define Fields for all
ContentTypesin the entire system, then whitelist access per-user by following this guide's recommendations: http://graphql-ruby.org/schema/limiting_visibility.htmltoastercup commentedon Nov 11, 2017
For a truly clean query interface (dynamic, per-user schemas and fields that don't rely on field hiding), we need to wait for the GraphQL-Ruby author to merge rmosolgo/graphql-ruby#1037. This is almost a complete rewrite of the library that will allow us to pass arguments into an
ObjectTypedefinition. Until then, we'll have to make do with a query interface that's a bit more verbose, and is not self-documenting in all places.toastercup commentedon Nov 11, 2017
Something nifty I'd found but forgot to link to: https://github.com/karmi/es-rails-example
toastercup commentedon Nov 12, 2017
And then GraphCMS comes along and blows our API out of the water.. https://graphiql.graphcms.com/simple/v1/swapi
We'll get there, though!
toastercup commentedon Nov 13, 2017
Decently hefty Rails example: https://github.com/howtographql/graphql-ruby
toastercup commentedon Nov 13, 2017
Sane structure guideline to help clean up our
QueryType: https://m.alphasights.com/graphql-ruby-clean-up-your-query-type-d7ab05a47084toastercup commentedon Nov 15, 2017
graphql-ruby1.8pre has been released, which will allow us to create per-user GraphQL schemas (which will hide irrelevant ContentTypes and Fields): https://github.com/rmosolgo/graphql-ruby/blob/1.8-dev/guides/schema/class_based_api.mdtoastercup commentedon Nov 17, 2017
Partially resolved by #536. Keeping this issue open to plan future refactors and features.