Class: GraphitiGraphQL::SchemaProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/graphiti_graphql.rb

Instance Method Summary collapse

Instance Method Details

#clear!Object



67
68
69
# File 'lib/graphiti_graphql.rb', line 67

def clear!
  @generated = nil
end

#generate!(resources: nil, entrypoints: nil) ⇒ Object

resources: All resources to put in the schema. Mostly just for testing. entrypoints: All resources to expose as top-level query objects



58
59
60
61
# File 'lib/graphiti_graphql.rb', line 58

def generate!(resources: nil, entrypoints: nil)
  @generated = GraphitiGraphQL::Schema
    .generate(resources: resources, entrypoints: entrypoints)
end

#generatedObject



52
53
54
# File 'lib/graphiti_graphql.rb', line 52

def generated
  @generated ||= GraphitiGraphQL::Schema.generate
end

#generated?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/graphiti_graphql.rb', line 63

def generated?
  !!@generated
end

#graphitiObject



48
49
50
# File 'lib/graphiti_graphql.rb', line 48

def graphiti
  generated.graphiti_schema
end

#graphqlObject



44
45
46
# File 'lib/graphiti_graphql.rb', line 44

def graphql
  generated.schema
end