add relay environment

This commit is contained in:
João Geonizeli
2021-08-05 12:11:48 -03:00
parent 5048dea211
commit 1feaf5579e
10 changed files with 593 additions and 76 deletions

View File

@@ -1,18 +1,17 @@
# frozen_string_literal: true
module Types
class QueryType < Types::BaseObject
# Add `node(id: ID!) and `nodes(ids: [ID!]!)`
include GraphQL::Types::Relay::HasNodeField
include GraphQL::Types::Relay::HasNodesField
# Add root-level fields here.
# They will be entry points for queries on your schema.
# TODO: remove me
field :test_field, String, null: false,
field :test_field, [String], null: false,
description: "An example field added by the generator"
def test_field
context[:current_user].email
[
SecureRandom.uuid,
SecureRandom.uuid,
]
end
end
end