Sha256: 45a3fdc620fac97d7dd281979ae1a33b210f59b2d9ccf96a8b050539e02fd0fc
Contents?: true
Size: 974 Bytes
Versions: 30
Compression:
Stored size: 974 Bytes
Contents
<%= schema_name %> = GraphQL::Schema.define do <% 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
30 entries across 30 versions & 1 rubygems