Skip to content

GraphQL + ElasticSearch #533

Open
Open

Description

@toastercup

JIRA:

https://careerbuilder.atlassian.net/browse/CE-307 (GraphQL)
https://careerbuilder.atlassian.net/browse/CE-160 (ElasticSearch Infrastructure)
https://careerbuilder.atlassian.net/browse/CE-503 (ElasticSearch FieldType Mappings)

MVP Features:

  • Queries for ContentItems, FieldItems, Fields, Users and Tenants, with basic arguments (find by ID)
  • Embedded GraphQL IDE
  • Batched + Preloaded queries to avoid N+1 Query issues
  • Rudimentary self-documented ObjectTypes
  • ActiveRecord backend, no ElasticSearch utilization yet. ElasticSearch required for release of Advice & Resources
  • No Sorting/Filtering/Searching Filtering and searching required for release of Advice & Resources
  • No Pagination Pagination required for release of Advice & Resources
  • No Mutations
  • No DevKey Authentication yet
  • No Authorization yet

Helpful resources:

Activity

  1. self-assigned this
    on Oct 18, 2017
  2. toastercup commented on Oct 25, 2017

    @toastercup
    MemberAuthor
  3. changed the title [-]GraphQL[/-] [+]GraphQL + ElasticSearch[/+] on Nov 2, 2017
  4. toastercup commented on Nov 7, 2017

    @toastercup
    MemberAuthor

    Particularly relevant; an ElasticSearch query builder DSL: https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-dsl

  5. toastercup commented on Nov 8, 2017

    @toastercup
    MemberAuthor

    graphql-ruby also has its own JS client: http://graphql-ruby.org/javascript_client/overview.html
    It also supports subscriptions with Apollo Client: http://graphql-ruby.org/javascript_client/apollo_subscriptions.html

  6. toastercup commented on Nov 8, 2017

    @toastercup
    MemberAuthor

    This is what I've been loosely following for dynamically generating the schema for FieldItems: http://graphql-ruby.org/schema/dynamic_schema.html

  7. toastercup commented on Nov 8, 2017

    @toastercup
    MemberAuthor

    We'll be using Rails's built-in API key functionality to authenticate API users: http://api.rubyonrails.org/classes/ActiveRecord/SecureToken/ClassMethods.html

  8. toastercup commented on Nov 8, 2017

    @toastercup
    MemberAuthor

    Good rundown of GraphQL Query core concepts with proper terminology: https://dev-blog.apollodata.com/the-anatomy-of-a-graphql-query-6dffa9e9e747

  9. toastercup commented on Nov 8, 2017

    @toastercup
    MemberAuthor

    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 FieldType ObjectTypes under a FieldItem abstract type, vastly simplifying our implementation and querying interface

  10. toastercup commented on Nov 8, 2017

    @toastercup
    MemberAuthor

    And an invaluable explanation of Interfaces and Unions: https://medium.com/the-graphqlhub/graphql-tour-interfaces-and-unions-7dd5be35de0d

  11. toastercup commented on Nov 9, 2017

    @toastercup
    MemberAuthor

    The approach I'm taking tonight (which should hopefully work) is to dynamically define Fields for all ContentTypes in the entire system, then whitelist access per-user by following this guide's recommendations: http://graphql-ruby.org/schema/limiting_visibility.html

  12. toastercup commented on Nov 11, 2017

    @toastercup
    MemberAuthor

    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.

  13. toastercup commented on Nov 11, 2017

    @toastercup
    MemberAuthor

    Something nifty I'd found but forgot to link to: https://github.com/karmi/es-rails-example

  14. toastercup commented on Nov 12, 2017

    @toastercup
    MemberAuthor

    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!

  15. toastercup commented on Nov 13, 2017

    @toastercup
    MemberAuthor

    Decently hefty Rails example: https://github.com/howtographql/graphql-ruby

  16. toastercup commented on Nov 13, 2017

    @toastercup
    MemberAuthor

    Sane structure guideline to help clean up our QueryType: https://m.alphasights.com/graphql-ruby-clean-up-your-query-type-d7ab05a47084

  17. toastercup commented on Nov 15, 2017

    @toastercup
    MemberAuthor

    graphql-ruby 1.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.md

  18. toastercup commented on Nov 17, 2017

    @toastercup
    MemberAuthor

    Partially resolved by #536. Keeping this issue open to plan future refactors and features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions