Sha256: b9c3f6baa29f8c8fff5e5bf52c1575f2ea0409917ec2291b9d92adf5524d9b3f
Contents?: true
Size: 1000 Bytes
Versions: 10
Compression:
Stored size: 1000 Bytes
Contents
<%= schema_name %> = GraphQL::Schema.define do query(Types::QueryType) <% if options[:relay] %> # Relay Object Identification: # Return a string UUID for `object` id_from_object ->(object, type_definition, query_ctx) { # Here's a simple implementation which: # - joins the type name & object.id # - encodes it with base64: # GraphQL::Schema::UniqueWithinType.encode(type_definition.name, object.id) } # Given a string UUID, find the object object_from_id ->(id, query_ctx) { # For example, to decode the UUIDs generated above: # type_name, item_id = GraphQL::Schema::UniqueWithinType.decode(id) # # Then, based on `type_name` and `id` # find an object in your application # ... } # Object Resolution resolve_type -> (obj, ctx) { # TODO: Implement this function # to return the correct type for `obj` raise(NotImplementedError) } <% end %><% if options[:batch] %> # GraphQL::Batch setup: use GraphQL::Batch <% end %>end
Version data entries
10 entries across 10 versions & 1 rubygems