Sha256: 2e6fc2b593a32cf665219766c5436d69304e68a2325ac7e54a14d769d5dc7117

Contents?: true

Size: 721 Bytes

Versions: 65

Compression:

Stored size: 721 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  class Schema
    class Member
      module HasAstNode
        def self.extended(child_cls)
          super
          child_cls.ast_node = nil
        end

        def inherited(child_cls)
          super
          child_cls.ast_node = nil
        end

        # If this schema was parsed from a `.graphql` file (or other SDL),
        # this is the AST node that defined this part of the schema.
        def ast_node(new_ast_node = nil)
          if new_ast_node
            @ast_node = new_ast_node
          elsif defined?(@ast_node)
            @ast_node
          else
            nil
          end
        end

        attr_writer :ast_node
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
graphql-2.4.4 lib/graphql/schema/member/has_ast_node.rb
graphql-2.4.3 lib/graphql/schema/member/has_ast_node.rb
graphql-2.4.2 lib/graphql/schema/member/has_ast_node.rb
graphql-2.4.1 lib/graphql/schema/member/has_ast_node.rb
graphql-2.4.0 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.20 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.19 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.18 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.17 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.16 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.15 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.14 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.13 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.12 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.11 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.10 lib/graphql/schema/member/has_ast_node.rb
graphql-2.2.16 lib/graphql/schema/member/has_ast_node.rb
graphql-2.1.13 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.9 lib/graphql/schema/member/has_ast_node.rb
graphql-2.3.8 lib/graphql/schema/member/has_ast_node.rb