lib/graphql/schema/printer.rb in graphql-1.10.0.pre1 vs lib/graphql/schema/printer.rb in graphql-1.10.0.pre2

- old
+ new

@@ -52,17 +52,18 @@ except: except, include_introspection_types: introspection, ) @document = @document_from_schema.document - @schema = schema end # Return the GraphQL schema string for the introspection type system def self.print_introspection_schema - query_root = ObjectType.define(name: "Root") + query_root = ObjectType.define(name: "Root") do + field :throwaway_field, types.String + end schema = GraphQL::Schema.define(query: query_root) introspection_schema_ast = GraphQL::Language::DocumentFromSchemaDefinition.new( schema, except: ->(member, _) { member.name == "Root" }, @@ -95,10 +96,10 @@ def print_directive(directive) if directive.name == "deprecated" reason = directive.arguments.find { |arg| arg.name == "reason" } - if reason.value == GraphQL::Directive::DEFAULT_DEPRECATION_REASON + if reason.value == GraphQL::Schema::Directive::DEFAULT_DEPRECATION_REASON "@deprecated" else "@deprecated(reason: #{reason.value.to_s.inspect})" end else