graphql 1.11.11 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of graphql might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/generators/graphql/install_generator.rb +5 -5
- data/lib/generators/graphql/relay_generator.rb +63 -0
- data/lib/generators/graphql/templates/base_connection.erb +8 -0
- data/lib/generators/graphql/templates/base_edge.erb +8 -0
- data/lib/generators/graphql/templates/node_type.erb +9 -0
- data/lib/generators/graphql/templates/object.erb +1 -1
- data/lib/generators/graphql/templates/query_type.erb +1 -3
- data/lib/generators/graphql/templates/schema.erb +8 -35
- data/lib/graphql/analysis/analyze_query.rb +7 -0
- data/lib/graphql/analysis/ast/visitor.rb +9 -1
- data/lib/graphql/analysis/ast.rb +11 -2
- data/lib/graphql/backtrace/legacy_tracer.rb +56 -0
- data/lib/graphql/backtrace/table.rb +22 -2
- data/lib/graphql/backtrace/tracer.rb +40 -9
- data/lib/graphql/backtrace.rb +28 -19
- data/lib/graphql/backwards_compatibility.rb +1 -0
- data/lib/graphql/compatibility/execution_specification.rb +1 -0
- data/lib/graphql/compatibility/lazy_execution_specification.rb +2 -0
- data/lib/graphql/compatibility/query_parser_specification.rb +2 -0
- data/lib/graphql/compatibility/schema_parser_specification.rb +2 -0
- data/lib/graphql/dataloader/null_dataloader.rb +21 -0
- data/lib/graphql/dataloader/request.rb +24 -0
- data/lib/graphql/dataloader/request_all.rb +22 -0
- data/lib/graphql/dataloader/source.rb +93 -0
- data/lib/graphql/dataloader.rb +197 -0
- data/lib/graphql/define/assign_global_id_field.rb +1 -1
- data/lib/graphql/define/instance_definable.rb +32 -2
- data/lib/graphql/define/type_definer.rb +5 -5
- data/lib/graphql/deprecated_dsl.rb +5 -0
- data/lib/graphql/enum_type.rb +2 -0
- data/lib/graphql/execution/errors.rb +4 -0
- data/lib/graphql/execution/execute.rb +7 -0
- data/lib/graphql/execution/interpreter/arguments.rb +51 -14
- data/lib/graphql/execution/interpreter/handles_raw_value.rb +0 -7
- data/lib/graphql/execution/interpreter/runtime.rb +210 -124
- data/lib/graphql/execution/interpreter.rb +10 -6
- data/lib/graphql/execution/multiplex.rb +20 -6
- data/lib/graphql/function.rb +4 -0
- data/lib/graphql/input_object_type.rb +2 -0
- data/lib/graphql/interface_type.rb +3 -1
- data/lib/graphql/language/document_from_schema_definition.rb +50 -23
- data/lib/graphql/language/nodes.rb +0 -5
- data/lib/graphql/language/visitor.rb +0 -1
- data/lib/graphql/object_type.rb +2 -0
- data/lib/graphql/pagination/connection.rb +5 -1
- data/lib/graphql/pagination/connections.rb +6 -16
- data/lib/graphql/query/context.rb +4 -0
- data/lib/graphql/query/serial_execution.rb +1 -0
- data/lib/graphql/query.rb +2 -0
- data/lib/graphql/relay/base_connection.rb +7 -0
- data/lib/graphql/relay/connection_instrumentation.rb +4 -4
- data/lib/graphql/relay/connection_type.rb +1 -1
- data/lib/graphql/relay/mutation.rb +1 -0
- data/lib/graphql/relay/node.rb +3 -0
- data/lib/graphql/relay/type_extensions.rb +2 -0
- data/lib/graphql/scalar_type.rb +2 -0
- data/lib/graphql/schema/argument.rb +30 -10
- data/lib/graphql/schema/build_from_definition.rb +145 -58
- data/lib/graphql/schema/directive/flagged.rb +57 -0
- data/lib/graphql/schema/directive.rb +76 -0
- data/lib/graphql/schema/enum.rb +3 -0
- data/lib/graphql/schema/enum_value.rb +13 -7
- data/lib/graphql/schema/field/connection_extension.rb +3 -2
- data/lib/graphql/schema/field.rb +28 -10
- data/lib/graphql/schema/input_object.rb +36 -28
- data/lib/graphql/schema/interface.rb +1 -0
- data/lib/graphql/schema/member/base_dsl_methods.rb +1 -0
- data/lib/graphql/schema/member/build_type.rb +3 -3
- data/lib/graphql/schema/member/has_arguments.rb +24 -6
- data/lib/graphql/schema/member/has_deprecation_reason.rb +25 -0
- data/lib/graphql/schema/member/has_directives.rb +98 -0
- data/lib/graphql/schema/member/has_validators.rb +31 -0
- data/lib/graphql/schema/member/type_system_helpers.rb +1 -1
- data/lib/graphql/schema/member.rb +4 -0
- data/lib/graphql/schema/object.rb +11 -0
- data/lib/graphql/schema/printer.rb +5 -4
- data/lib/graphql/schema/resolver/has_payload_type.rb +2 -0
- data/lib/graphql/schema/resolver.rb +7 -0
- data/lib/graphql/schema/subscription.rb +19 -1
- data/lib/graphql/schema/timeout_middleware.rb +2 -0
- data/lib/graphql/schema/validation.rb +2 -0
- data/lib/graphql/schema/validator/exclusion_validator.rb +31 -0
- data/lib/graphql/schema/validator/format_validator.rb +49 -0
- data/lib/graphql/schema/validator/inclusion_validator.rb +33 -0
- data/lib/graphql/schema/validator/length_validator.rb +57 -0
- data/lib/graphql/schema/validator/numericality_validator.rb +71 -0
- data/lib/graphql/schema/validator/required_validator.rb +68 -0
- data/lib/graphql/schema/validator.rb +163 -0
- data/lib/graphql/schema.rb +61 -23
- data/lib/graphql/static_validation/validator.rb +2 -0
- data/lib/graphql/subscriptions.rb +17 -20
- data/lib/graphql/tracing/appoptics_tracing.rb +3 -1
- data/lib/graphql/tracing/platform_tracing.rb +3 -1
- data/lib/graphql/tracing/skylight_tracing.rb +1 -1
- data/lib/graphql/tracing.rb +2 -2
- data/lib/graphql/types/relay/base_connection.rb +2 -92
- data/lib/graphql/types/relay/base_edge.rb +2 -35
- data/lib/graphql/types/relay/connection_behaviors.rb +123 -0
- data/lib/graphql/types/relay/default_relay.rb +27 -0
- data/lib/graphql/types/relay/edge_behaviors.rb +42 -0
- data/lib/graphql/types/relay/has_node_field.rb +41 -0
- data/lib/graphql/types/relay/has_nodes_field.rb +41 -0
- data/lib/graphql/types/relay/node.rb +2 -4
- data/lib/graphql/types/relay/node_behaviors.rb +15 -0
- data/lib/graphql/types/relay/node_field.rb +1 -19
- data/lib/graphql/types/relay/nodes_field.rb +1 -19
- data/lib/graphql/types/relay/page_info.rb +2 -14
- data/lib/graphql/types/relay/page_info_behaviors.rb +25 -0
- data/lib/graphql/types/relay.rb +11 -3
- data/lib/graphql/union_type.rb +2 -0
- data/lib/graphql/upgrader/member.rb +1 -0
- data/lib/graphql/upgrader/schema.rb +1 -0
- data/lib/graphql/version.rb +1 -1
- data/lib/graphql.rb +38 -4
- metadata +34 -9
- data/lib/graphql/types/relay/base_field.rb +0 -22
- data/lib/graphql/types/relay/base_interface.rb +0 -29
- data/lib/graphql/types/relay/base_object.rb +0 -26
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GraphQL
|
4
|
+
module Types
|
5
|
+
module Relay
|
6
|
+
module EdgeBehaviors
|
7
|
+
def self.included(child_class)
|
8
|
+
child_class.description("An edge in a connection.")
|
9
|
+
child_class.field(:cursor, String, null: false, description: "A cursor for use in pagination.")
|
10
|
+
child_class.extend(ClassMethods)
|
11
|
+
end
|
12
|
+
|
13
|
+
module ClassMethods
|
14
|
+
# Get or set the Object type that this edge wraps.
|
15
|
+
#
|
16
|
+
# @param node_type [Class] A `Schema::Object` subclass
|
17
|
+
# @param null [Boolean]
|
18
|
+
def node_type(node_type = nil, null: true)
|
19
|
+
if node_type
|
20
|
+
@node_type = node_type
|
21
|
+
# Add a default `node` field
|
22
|
+
field :node, node_type, null: null, description: "The item at the end of the edge.", connection: false
|
23
|
+
end
|
24
|
+
@node_type
|
25
|
+
end
|
26
|
+
|
27
|
+
def authorized?(obj, ctx)
|
28
|
+
true
|
29
|
+
end
|
30
|
+
|
31
|
+
def accessible?(ctx)
|
32
|
+
node_type.accessible?(ctx)
|
33
|
+
end
|
34
|
+
|
35
|
+
def visible?(ctx)
|
36
|
+
node_type.visible?(ctx)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GraphQL
|
4
|
+
module Types
|
5
|
+
module Relay
|
6
|
+
module HasNodeField
|
7
|
+
def self.included(child_class)
|
8
|
+
child_class.field(**field_options, &field_block)
|
9
|
+
end
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def field_options
|
13
|
+
{
|
14
|
+
name: "node",
|
15
|
+
owner: nil,
|
16
|
+
type: GraphQL::Types::Relay::Node,
|
17
|
+
null: true,
|
18
|
+
description: "Fetches an object given its ID.",
|
19
|
+
relay_node_field: true,
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def field_block
|
24
|
+
Proc.new {
|
25
|
+
argument :id, "ID!", required: true,
|
26
|
+
description: "ID of the object."
|
27
|
+
|
28
|
+
def resolve(obj, args, ctx)
|
29
|
+
ctx.schema.object_from_id(args[:id], ctx)
|
30
|
+
end
|
31
|
+
|
32
|
+
def resolve_field(obj, args, ctx)
|
33
|
+
resolve(obj, args, ctx)
|
34
|
+
end
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GraphQL
|
4
|
+
module Types
|
5
|
+
module Relay
|
6
|
+
module HasNodesField
|
7
|
+
def self.included(child_class)
|
8
|
+
child_class.field(**field_options, &field_block)
|
9
|
+
end
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def field_options
|
13
|
+
{
|
14
|
+
name: "nodes",
|
15
|
+
owner: nil,
|
16
|
+
type: [GraphQL::Types::Relay::Node, null: true],
|
17
|
+
null: false,
|
18
|
+
description: "Fetches a list of objects given a list of IDs.",
|
19
|
+
relay_nodes_field: true,
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def field_block
|
24
|
+
Proc.new {
|
25
|
+
argument :ids, "[ID!]!", required: true,
|
26
|
+
description: "IDs of the objects."
|
27
|
+
|
28
|
+
def resolve(obj, args, ctx)
|
29
|
+
args[:ids].map { |id| ctx.schema.object_from_id(id, ctx) }
|
30
|
+
end
|
31
|
+
|
32
|
+
def resolve_field(obj, args, ctx)
|
33
|
+
resolve(obj, args, ctx)
|
34
|
+
end
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -7,10 +7,8 @@ module GraphQL
|
|
7
7
|
# or you can take it as inspiration for your own implementation
|
8
8
|
# of the `Node` interface.
|
9
9
|
module Node
|
10
|
-
include
|
11
|
-
|
12
|
-
description "An object with an ID."
|
13
|
-
field(:id, ID, null: false, description: "ID of the object.")
|
10
|
+
include GraphQL::Schema::Interface
|
11
|
+
include Types::Relay::NodeBehaviors
|
14
12
|
end
|
15
13
|
end
|
16
14
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GraphQL
|
4
|
+
module Types
|
5
|
+
module Relay
|
6
|
+
module NodeBehaviors
|
7
|
+
def self.included(child_module)
|
8
|
+
child_module.extend(DefaultRelay)
|
9
|
+
child_module.description("An object with an ID.")
|
10
|
+
child_module.field(:id, ID, null: false, description: "ID of the object.")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -19,25 +19,7 @@ module GraphQL
|
|
19
19
|
# context.schema.object_from_id(id, context)
|
20
20
|
# end
|
21
21
|
#
|
22
|
-
NodeField = GraphQL::Schema::Field.new(
|
23
|
-
name: "node",
|
24
|
-
owner: nil,
|
25
|
-
type: GraphQL::Types::Relay::Node,
|
26
|
-
null: true,
|
27
|
-
description: "Fetches an object given its ID.",
|
28
|
-
relay_node_field: true,
|
29
|
-
) do
|
30
|
-
argument :id, "ID!", required: true,
|
31
|
-
description: "ID of the object."
|
32
|
-
|
33
|
-
def resolve(obj, args, ctx)
|
34
|
-
ctx.schema.object_from_id(args[:id], ctx)
|
35
|
-
end
|
36
|
-
|
37
|
-
def resolve_field(obj, args, ctx)
|
38
|
-
resolve(obj, args, ctx)
|
39
|
-
end
|
40
|
-
end
|
22
|
+
NodeField = GraphQL::Schema::Field.new(**HasNodeField.field_options, &HasNodeField.field_block)
|
41
23
|
end
|
42
24
|
end
|
43
25
|
end
|
@@ -21,25 +21,7 @@ module GraphQL
|
|
21
21
|
# end
|
22
22
|
# end
|
23
23
|
#
|
24
|
-
NodesField = GraphQL::Schema::Field.new(
|
25
|
-
name: "nodes",
|
26
|
-
owner: nil,
|
27
|
-
type: [GraphQL::Types::Relay::Node, null: true],
|
28
|
-
null: false,
|
29
|
-
description: "Fetches a list of objects given a list of IDs.",
|
30
|
-
relay_nodes_field: true,
|
31
|
-
) do
|
32
|
-
argument :ids, "[ID!]!", required: true,
|
33
|
-
description: "IDs of the objects."
|
34
|
-
|
35
|
-
def resolve(obj, args, ctx)
|
36
|
-
args[:ids].map { |id| ctx.schema.object_from_id(id, ctx) }
|
37
|
-
end
|
38
|
-
|
39
|
-
def resolve_field(obj, args, ctx)
|
40
|
-
resolve(obj, args, ctx)
|
41
|
-
end
|
42
|
-
end
|
24
|
+
NodesField = GraphQL::Schema::Field.new(**HasNodesField.field_options, &HasNodesField.field_block)
|
43
25
|
end
|
44
26
|
end
|
45
27
|
end
|
@@ -3,20 +3,8 @@ module GraphQL
|
|
3
3
|
module Types
|
4
4
|
module Relay
|
5
5
|
# The return type of a connection's `pageInfo` field
|
6
|
-
class PageInfo <
|
7
|
-
|
8
|
-
description "Information about pagination in a connection."
|
9
|
-
field :has_next_page, Boolean, null: false,
|
10
|
-
description: "When paginating forwards, are there more items?"
|
11
|
-
|
12
|
-
field :has_previous_page, Boolean, null: false,
|
13
|
-
description: "When paginating backwards, are there more items?"
|
14
|
-
|
15
|
-
field :start_cursor, String, null: true,
|
16
|
-
description: "When paginating backwards, the cursor to continue."
|
17
|
-
|
18
|
-
field :end_cursor, String, null: true,
|
19
|
-
description: "When paginating forwards, the cursor to continue."
|
6
|
+
class PageInfo < GraphQL::Schema::Object
|
7
|
+
include PageInfoBehaviors
|
20
8
|
end
|
21
9
|
end
|
22
10
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module GraphQL
|
3
|
+
module Types
|
4
|
+
module Relay
|
5
|
+
module PageInfoBehaviors
|
6
|
+
def self.included(child_class)
|
7
|
+
child_class.extend GraphQL::Types::Relay::DefaultRelay
|
8
|
+
|
9
|
+
child_class.description "Information about pagination in a connection."
|
10
|
+
child_class.field :has_next_page, Boolean, null: false,
|
11
|
+
description: "When paginating forwards, are there more items?"
|
12
|
+
|
13
|
+
child_class.field :has_previous_page, Boolean, null: false,
|
14
|
+
description: "When paginating backwards, are there more items?"
|
15
|
+
|
16
|
+
child_class.field :start_cursor, String, null: true,
|
17
|
+
description: "When paginating backwards, the cursor to continue."
|
18
|
+
|
19
|
+
child_class.field :end_cursor, String, null: true,
|
20
|
+
description: "When paginating forwards, the cursor to continue."
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/graphql/types/relay.rb
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
4
|
-
require "graphql/types/relay/
|
2
|
+
|
3
|
+
# behavior modules:
|
4
|
+
require "graphql/types/relay/default_relay"
|
5
|
+
require "graphql/types/relay/connection_behaviors"
|
6
|
+
require "graphql/types/relay/edge_behaviors"
|
7
|
+
require "graphql/types/relay/node_behaviors"
|
8
|
+
require "graphql/types/relay/page_info_behaviors"
|
9
|
+
require "graphql/types/relay/has_node_field"
|
10
|
+
require "graphql/types/relay/has_nodes_field"
|
11
|
+
|
12
|
+
# concrete classes based on the gem defaults:
|
5
13
|
require "graphql/types/relay/page_info"
|
6
14
|
require "graphql/types/relay/base_connection"
|
7
15
|
require "graphql/types/relay/base_edge"
|
data/lib/graphql/union_type.rb
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
module GraphQL
|
3
3
|
# @api deprecated
|
4
4
|
class UnionType < GraphQL::BaseType
|
5
|
+
extend Define::InstanceDefinable::DeprecatedDefine
|
6
|
+
|
5
7
|
# Rubocop was unhappy about the syntax when this was a proc literal
|
6
8
|
class AcceptPossibleTypesDefinition
|
7
9
|
def self.call(target, possible_types, options = {})
|
@@ -771,6 +771,7 @@ module GraphQL
|
|
771
771
|
|
772
772
|
class Member
|
773
773
|
def initialize(member, skip: SkipOnNullKeyword, type_transforms: DEFAULT_TYPE_TRANSFORMS, field_transforms: DEFAULT_FIELD_TRANSFORMS, clean_up_transforms: DEFAULT_CLEAN_UP_TRANSFORMS)
|
774
|
+
warn "#{self.class} will be removed from GraphQL-Ruby 2.0 (but there's no point in using it after you've transformed your code, anyways)"
|
774
775
|
@member = member
|
775
776
|
@skip = skip
|
776
777
|
@type_transforms = type_transforms
|
data/lib/graphql/version.rb
CHANGED
data/lib/graphql.rb
CHANGED
@@ -110,6 +110,7 @@ require "graphql/execution"
|
|
110
110
|
require "graphql/runtime_type_error"
|
111
111
|
require "graphql/unresolved_type_error"
|
112
112
|
require "graphql/invalid_null_error"
|
113
|
+
require "graphql/pagination"
|
113
114
|
require "graphql/schema"
|
114
115
|
require "graphql/query"
|
115
116
|
require "graphql/directive"
|
@@ -124,6 +125,9 @@ require "graphql/string_type"
|
|
124
125
|
require "graphql/schema/built_in_types"
|
125
126
|
require "graphql/schema/loader"
|
126
127
|
require "graphql/schema/printer"
|
128
|
+
require "graphql/filter"
|
129
|
+
require "graphql/internal_representation"
|
130
|
+
require "graphql/static_validation"
|
127
131
|
require "graphql/introspection"
|
128
132
|
|
129
133
|
require "graphql/analysis_error"
|
@@ -132,12 +136,9 @@ require "graphql/invalid_name_error"
|
|
132
136
|
require "graphql/integer_decoding_error"
|
133
137
|
require "graphql/integer_encoding_error"
|
134
138
|
require "graphql/string_encoding_error"
|
135
|
-
require "graphql/internal_representation"
|
136
|
-
require "graphql/static_validation"
|
137
139
|
require "graphql/version"
|
138
140
|
require "graphql/compatibility"
|
139
141
|
require "graphql/function"
|
140
|
-
require "graphql/filter"
|
141
142
|
require "graphql/subscriptions"
|
142
143
|
require "graphql/parse_error"
|
143
144
|
require "graphql/backtrace"
|
@@ -147,4 +148,37 @@ require "graphql/authorization"
|
|
147
148
|
require "graphql/unauthorized_error"
|
148
149
|
require "graphql/unauthorized_field_error"
|
149
150
|
require "graphql/load_application_object_failed_error"
|
150
|
-
require "graphql/
|
151
|
+
require "graphql/dataloader"
|
152
|
+
|
153
|
+
|
154
|
+
module GraphQL
|
155
|
+
# Ruby has `deprecate_constant`,
|
156
|
+
# but I don't see a way to give a nice error message in that case,
|
157
|
+
# so I'm doing this instead.
|
158
|
+
DEPRECATED_INT_TYPE = INT_TYPE
|
159
|
+
DEPRECATED_FLOAT_TYPE = FLOAT_TYPE
|
160
|
+
DEPRECATED_STRING_TYPE = STRING_TYPE
|
161
|
+
DEPRECATED_BOOLEAN_TYPE = BOOLEAN_TYPE
|
162
|
+
DEPRECATED_ID_TYPE = ID_TYPE
|
163
|
+
|
164
|
+
remove_const :INT_TYPE
|
165
|
+
remove_const :FLOAT_TYPE
|
166
|
+
remove_const :STRING_TYPE
|
167
|
+
remove_const :BOOLEAN_TYPE
|
168
|
+
remove_const :ID_TYPE
|
169
|
+
|
170
|
+
def self.const_missing(const_name)
|
171
|
+
deprecated_const_name = :"DEPRECATED_#{const_name}"
|
172
|
+
if const_defined?(deprecated_const_name)
|
173
|
+
deprecated_type = const_get(deprecated_const_name)
|
174
|
+
deprecated_caller = caller(1, 1).first
|
175
|
+
# Don't warn about internal uses, like `types.Int`
|
176
|
+
if !deprecated_caller.include?("lib/graphql")
|
177
|
+
warn "GraphQL::#{const_name} is deprecated and will be removed in GraphQL-Ruby 2.0, use GraphQL::Types::#{deprecated_type.graphql_name} instead. (from #{deprecated_caller})"
|
178
|
+
end
|
179
|
+
deprecated_type
|
180
|
+
else
|
181
|
+
super
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Mosolgo
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: benchmark-ips
|
@@ -334,8 +334,11 @@ files:
|
|
334
334
|
- lib/generators/graphql/loader_generator.rb
|
335
335
|
- lib/generators/graphql/mutation_generator.rb
|
336
336
|
- lib/generators/graphql/object_generator.rb
|
337
|
+
- lib/generators/graphql/relay_generator.rb
|
337
338
|
- lib/generators/graphql/scalar_generator.rb
|
338
339
|
- lib/generators/graphql/templates/base_argument.erb
|
340
|
+
- lib/generators/graphql/templates/base_connection.erb
|
341
|
+
- lib/generators/graphql/templates/base_edge.erb
|
339
342
|
- lib/generators/graphql/templates/base_enum.erb
|
340
343
|
- lib/generators/graphql/templates/base_field.erb
|
341
344
|
- lib/generators/graphql/templates/base_input_object.erb
|
@@ -350,6 +353,7 @@ files:
|
|
350
353
|
- lib/generators/graphql/templates/loader.erb
|
351
354
|
- lib/generators/graphql/templates/mutation.erb
|
352
355
|
- lib/generators/graphql/templates/mutation_type.erb
|
356
|
+
- lib/generators/graphql/templates/node_type.erb
|
353
357
|
- lib/generators/graphql/templates/object.erb
|
354
358
|
- lib/generators/graphql/templates/query_type.erb
|
355
359
|
- lib/generators/graphql/templates/scalar.erb
|
@@ -379,6 +383,7 @@ files:
|
|
379
383
|
- lib/graphql/authorization.rb
|
380
384
|
- lib/graphql/backtrace.rb
|
381
385
|
- lib/graphql/backtrace/inspect_result.rb
|
386
|
+
- lib/graphql/backtrace/legacy_tracer.rb
|
382
387
|
- lib/graphql/backtrace/table.rb
|
383
388
|
- lib/graphql/backtrace/traced_error.rb
|
384
389
|
- lib/graphql/backtrace/tracer.rb
|
@@ -396,6 +401,11 @@ files:
|
|
396
401
|
- lib/graphql/compatibility/query_parser_specification/parse_error_specification.rb
|
397
402
|
- lib/graphql/compatibility/query_parser_specification/query_assertions.rb
|
398
403
|
- lib/graphql/compatibility/schema_parser_specification.rb
|
404
|
+
- lib/graphql/dataloader.rb
|
405
|
+
- lib/graphql/dataloader/null_dataloader.rb
|
406
|
+
- lib/graphql/dataloader/request.rb
|
407
|
+
- lib/graphql/dataloader/request_all.rb
|
408
|
+
- lib/graphql/dataloader/source.rb
|
399
409
|
- lib/graphql/define.rb
|
400
410
|
- lib/graphql/define/assign_argument.rb
|
401
411
|
- lib/graphql/define/assign_connection.rb
|
@@ -555,6 +565,7 @@ files:
|
|
555
565
|
- lib/graphql/schema/directive.rb
|
556
566
|
- lib/graphql/schema/directive/deprecated.rb
|
557
567
|
- lib/graphql/schema/directive/feature.rb
|
568
|
+
- lib/graphql/schema/directive/flagged.rb
|
558
569
|
- lib/graphql/schema/directive/include.rb
|
559
570
|
- lib/graphql/schema/directive/skip.rb
|
560
571
|
- lib/graphql/schema/directive/transform.rb
|
@@ -581,9 +592,12 @@ files:
|
|
581
592
|
- lib/graphql/schema/member/graphql_type_names.rb
|
582
593
|
- lib/graphql/schema/member/has_arguments.rb
|
583
594
|
- lib/graphql/schema/member/has_ast_node.rb
|
595
|
+
- lib/graphql/schema/member/has_deprecation_reason.rb
|
596
|
+
- lib/graphql/schema/member/has_directives.rb
|
584
597
|
- lib/graphql/schema/member/has_fields.rb
|
585
598
|
- lib/graphql/schema/member/has_path.rb
|
586
599
|
- lib/graphql/schema/member/has_unresolved_type_error.rb
|
600
|
+
- lib/graphql/schema/member/has_validators.rb
|
587
601
|
- lib/graphql/schema/member/instrumentation.rb
|
588
602
|
- lib/graphql/schema/member/relay_shortcuts.rb
|
589
603
|
- lib/graphql/schema/member/scoped.rb
|
@@ -610,6 +624,13 @@ files:
|
|
610
624
|
- lib/graphql/schema/union.rb
|
611
625
|
- lib/graphql/schema/unique_within_type.rb
|
612
626
|
- lib/graphql/schema/validation.rb
|
627
|
+
- lib/graphql/schema/validator.rb
|
628
|
+
- lib/graphql/schema/validator/exclusion_validator.rb
|
629
|
+
- lib/graphql/schema/validator/format_validator.rb
|
630
|
+
- lib/graphql/schema/validator/inclusion_validator.rb
|
631
|
+
- lib/graphql/schema/validator/length_validator.rb
|
632
|
+
- lib/graphql/schema/validator/numericality_validator.rb
|
633
|
+
- lib/graphql/schema/validator/required_validator.rb
|
613
634
|
- lib/graphql/schema/warden.rb
|
614
635
|
- lib/graphql/schema/wrapper.rb
|
615
636
|
- lib/graphql/static_validation.rb
|
@@ -716,13 +737,17 @@ files:
|
|
716
737
|
- lib/graphql/types/relay.rb
|
717
738
|
- lib/graphql/types/relay/base_connection.rb
|
718
739
|
- lib/graphql/types/relay/base_edge.rb
|
719
|
-
- lib/graphql/types/relay/
|
720
|
-
- lib/graphql/types/relay/
|
721
|
-
- lib/graphql/types/relay/
|
740
|
+
- lib/graphql/types/relay/connection_behaviors.rb
|
741
|
+
- lib/graphql/types/relay/default_relay.rb
|
742
|
+
- lib/graphql/types/relay/edge_behaviors.rb
|
743
|
+
- lib/graphql/types/relay/has_node_field.rb
|
744
|
+
- lib/graphql/types/relay/has_nodes_field.rb
|
722
745
|
- lib/graphql/types/relay/node.rb
|
746
|
+
- lib/graphql/types/relay/node_behaviors.rb
|
723
747
|
- lib/graphql/types/relay/node_field.rb
|
724
748
|
- lib/graphql/types/relay/nodes_field.rb
|
725
749
|
- lib/graphql/types/relay/page_info.rb
|
750
|
+
- lib/graphql/types/relay/page_info_behaviors.rb
|
726
751
|
- lib/graphql/types/string.rb
|
727
752
|
- lib/graphql/unauthorized_error.rb
|
728
753
|
- lib/graphql/unauthorized_field_error.rb
|
@@ -741,7 +766,7 @@ metadata:
|
|
741
766
|
source_code_uri: https://github.com/rmosolgo/graphql-ruby
|
742
767
|
bug_tracker_uri: https://github.com/rmosolgo/graphql-ruby/issues
|
743
768
|
mailing_list_uri: https://tinyletter.com/graphql-ruby
|
744
|
-
post_install_message:
|
769
|
+
post_install_message:
|
745
770
|
rdoc_options: []
|
746
771
|
require_paths:
|
747
772
|
- lib
|
@@ -756,8 +781,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
756
781
|
- !ruby/object:Gem::Version
|
757
782
|
version: '0'
|
758
783
|
requirements: []
|
759
|
-
rubygems_version: 3.
|
760
|
-
signing_key:
|
784
|
+
rubygems_version: 3.2.3
|
785
|
+
signing_key:
|
761
786
|
specification_version: 4
|
762
787
|
summary: A GraphQL language and runtime for Ruby
|
763
788
|
test_files: []
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module GraphQL
|
4
|
-
module Types
|
5
|
-
module Relay
|
6
|
-
class BaseField < GraphQL::Schema::Field
|
7
|
-
def initialize(edge_class: nil, **rest, &block)
|
8
|
-
@edge_class = edge_class
|
9
|
-
super(**rest, &block)
|
10
|
-
end
|
11
|
-
|
12
|
-
def to_graphql
|
13
|
-
field = super
|
14
|
-
if @edge_class
|
15
|
-
field.edge_class = @edge_class
|
16
|
-
end
|
17
|
-
field
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module GraphQL
|
4
|
-
module Types
|
5
|
-
module Relay
|
6
|
-
module BaseInterface
|
7
|
-
include GraphQL::Schema::Interface
|
8
|
-
|
9
|
-
field_class(Types::Relay::BaseField)
|
10
|
-
|
11
|
-
definition_methods do
|
12
|
-
def default_relay(new_value)
|
13
|
-
@default_relay = new_value
|
14
|
-
end
|
15
|
-
|
16
|
-
def default_relay?
|
17
|
-
!!@default_relay
|
18
|
-
end
|
19
|
-
|
20
|
-
def to_graphql
|
21
|
-
type_defn = super
|
22
|
-
type_defn.default_relay = default_relay?
|
23
|
-
type_defn
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module GraphQL
|
4
|
-
module Types
|
5
|
-
module Relay
|
6
|
-
class BaseObject < GraphQL::Schema::Object
|
7
|
-
field_class(Types::Relay::BaseField)
|
8
|
-
class << self
|
9
|
-
def default_relay(new_value)
|
10
|
-
@default_relay = new_value
|
11
|
-
end
|
12
|
-
|
13
|
-
def default_relay?
|
14
|
-
!!@default_relay
|
15
|
-
end
|
16
|
-
|
17
|
-
def to_graphql
|
18
|
-
type_defn = super
|
19
|
-
type_defn.default_relay = default_relay?
|
20
|
-
type_defn
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|