Skip to content

undefined method 'stellate_service_name' #6

@maxrosecollins

Description

@maxrosecollins

I'm trying to get this gem running but I'm facing an error.

! Unable to load application: NoMethodError: undefined method 'stellate_service_name' for class RanktrackerApiSchema
bundler: failed to load command: puma (/Users/max/.rbenv/versions/3.4.2/bin/puma)
/Users/max/.rbenv/versions/3.4.2/lib/ruby/gems/3.4.0/gems/stellate-1.1.0/lib/stellate.rb:125:in 'Stellate::SchemaSyncing.use': undefined method 'stellate_service_name' for class RanktrackerApiSchema (NoMethodError)

      unless schema.stellate_service_name.is_a?(String)

My schema file is as follows.

# frozen_string_literal: true
require 'stellate'

class RanktrackerApiSchema < GraphQL::Schema
  mutation(Types::MutationType)
  query(Types::QueryType)

  @stellate_service_name = "xxxxx"
  @stellate_token = "xxxxxx"


  use Stellate::SchemaSyncing

  # For batch-loading (see https://graphql-ruby.org/dataloader/overview.html)
  use GraphQL::Dataloader
  use GraphQL::Pro::Defer
  use GraphQL::Pro::Stream
  
  trace_with(GraphQL::Tracing::AppsignalTrace)

  # GraphQL-Ruby calls this when something goes wrong while running a query:
  def self.type_error(err, context)
    # 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 method
    # to return the correct GraphQL object type for `obj`
    raise(GraphQL::RequiredImplementationMissingError)
  end

  # Limit the size of incoming queries:
  max_query_string_tokens(5000)

  # Stop validating when it encounters this many errors:
  validate_max_errors(100)

  # Relay-style Object Identification:

  # Return a string UUID for `object`
  def self.id_from_object(object, type_definition, query_ctx)
    # For example, use Rails' GlobalID library (https://github.com/rails/globalid):
    object.to_gid_param
  end

  # Given a string UUID, find the object
  def self.object_from_id(global_id, query_ctx)
    # For example, use Rails' GlobalID library (https://github.com/rails/globalid):
    GlobalID.find(global_id)
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions