Sha256: d8a8345765a7822de806543686e46fff8479c05266b74a0707c8cdc4ed480780

Contents?: true

Size: 802 Bytes

Versions: 1

Compression:

Stored size: 802 Bytes

Contents

<% module_namespacing_when_supported do -%>
class <%= schema_name %> < GraphQL::Schema
  query(Types::QueryType)
<% if options[:batch] %>
  # GraphQL::Batch setup:
  use GraphQL::Batch
<% else %>
  # For batch-loading (see https://graphql-ruby.org/dataloader/overview.html)
  use GraphQL::Dataloader
<% end %>
  # GraphQL-Ruby calls this when something goes wrong while running a query:
  def self.type_error(err)
    # if err.is_a?(GraphQL::InvalidNullError)
    #   # report to your bug tracker here
    #   return nil
    # end
    super
  end

  # Union and Interface Resolution
  def self.resolve_type(abstract_type, obj, ctx)
    # TODO: Implement this function
    # to return the correct GraphQL object type for `obj`
    raise(GraphQL::RequiredImplementationMissingError)
  end
end
<% end -%>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
graphql-1.12.20 lib/generators/graphql/templates/schema.erb