From 394ee1f25a7c131d4a26f890fa2e5a8e4957d6ea Mon Sep 17 00:00:00 2001 From: rmosolgo Date: Thu, 2 Nov 2023 13:59:41 +0000 Subject: [PATCH] Updating to a3a142a4df261bcdfda506166c063c92a6209525. --- api-doc/2.1.6/Base64Bp.html | 290 + api-doc/2.1.6/GraphQL.html | 594 + api-doc/2.1.6/GraphQL/Analysis.html | 117 + api-doc/2.1.6/GraphQL/Analysis/AST.html | 507 + .../2.1.6/GraphQL/Analysis/AST/Analyzer.html | 497 + .../GraphQL/Analysis/AST/FieldUsage.html | 358 + .../Analysis/AST/MaxQueryComplexity.html | 250 + .../GraphQL/Analysis/AST/MaxQueryDepth.html | 243 + .../GraphQL/Analysis/AST/QueryComplexity.html | 452 + .../QueryComplexity/ScopedTypeComplexity.html | 823 + .../GraphQL/Analysis/AST/QueryDepth.html | 411 + .../2.1.6/GraphQL/Analysis/AST/Visitor.html | 1998 +++ api-doc/2.1.6/GraphQL/AnalysisError.html | 156 + api-doc/2.1.6/GraphQL/Backtrace.html | 441 + api-doc/2.1.6/GraphQL/Backtrace/Frame.html | 759 + .../GraphQL/Backtrace/InspectResult.html | 296 + api-doc/2.1.6/GraphQL/Backtrace/Table.html | 421 + api-doc/2.1.6/GraphQL/Backtrace/Trace.html | 547 + .../2.1.6/GraphQL/Backtrace/TracedError.html | 490 + api-doc/2.1.6/GraphQL/Backtrace/Tracer.html | 327 + api-doc/2.1.6/GraphQL/CoercionError.html | 309 + api-doc/2.1.6/GraphQL/Dataloader.html | 1468 ++ .../GraphQL/Dataloader/NullDataloader.html | 416 + api-doc/2.1.6/GraphQL/Dataloader/Request.html | 310 + .../2.1.6/GraphQL/Dataloader/RequestAll.html | 314 + api-doc/2.1.6/GraphQL/Dataloader/Source.html | 1531 ++ api-doc/2.1.6/GraphQL/DateEncodingError.html | 320 + api-doc/2.1.6/GraphQL/Deprecation.html | 175 + api-doc/2.1.6/GraphQL/Dig.html | 234 + .../2.1.6/GraphQL/DurationEncodingError.html | 320 + api-doc/2.1.6/GraphQL/EmptyObjects.html | 131 + api-doc/2.1.6/GraphQL/Error.html | 128 + api-doc/2.1.6/GraphQL/Execution.html | 149 + .../GraphQL/Execution/DirectiveChecks.html | 306 + api-doc/2.1.6/GraphQL/Execution/Errors.html | 459 + .../2.1.6/GraphQL/Execution/Interpreter.html | 564 + .../Execution/Interpreter/ArgumentValue.html | 492 + .../Execution/Interpreter/Arguments.html | 761 + .../Execution/Interpreter/ArgumentsCache.html | 414 + .../Interpreter/ExecutionErrors.html | 284 + .../Interpreter/ListResultFailedError.html | 226 + .../Execution/Interpreter/RawValue.html | 270 + .../Execution/Interpreter/Resolve.html | 431 + .../Execution/Interpreter/Runtime.html | 3868 ++++ .../Interpreter/Runtime/CurrentState.html | 671 + .../Interpreter/Runtime/GraphQLResult.html | 751 + .../Runtime/GraphQLResultArray.html | 560 + .../Runtime/GraphQLResultHash.html | 965 + api-doc/2.1.6/GraphQL/Execution/Lazy.html | 721 + .../GraphQL/Execution/Lazy/LazyMethodMap.html | 583 + .../Lazy/LazyMethodMap/ConcurrentishMap.html | 448 + .../2.1.6/GraphQL/Execution/Lookahead.html | 1569 ++ .../Execution/Lookahead/NullLookahead.html | 550 + .../2.1.6/GraphQL/Execution/Multiplex.html | 737 + api-doc/2.1.6/GraphQL/Execution/Skip.html | 146 + api-doc/2.1.6/GraphQL/ExecutionError.html | 717 + .../2.1.6/GraphQL/IntegerDecodingError.html | 321 + .../2.1.6/GraphQL/IntegerEncodingError.html | 520 + api-doc/2.1.6/GraphQL/Introspection.html | 409 + .../GraphQL/Introspection/BaseObject.html | 373 + .../Introspection/DirectiveLocationEnum.html | 269 + .../GraphQL/Introspection/DirectiveType.html | 384 + .../GraphQL/Introspection/DynamicFields.html | 380 + .../GraphQL/Introspection/EntryPoints.html | 439 + .../GraphQL/Introspection/EnumValueType.html | 433 + .../GraphQL/Introspection/FieldType.html | 437 + .../GraphQL/Introspection/InputValueType.html | 465 + .../GraphQL/Introspection/SchemaType.html | 645 + .../GraphQL/Introspection/TypeKindEnum.html | 269 + .../2.1.6/GraphQL/Introspection/TypeType.html | 878 + api-doc/2.1.6/GraphQL/InvalidNameError.html | 384 + api-doc/2.1.6/GraphQL/InvalidNullError.html | 883 + api-doc/2.1.6/GraphQL/InvariantError.html | 229 + api-doc/2.1.6/GraphQL/Language.html | 236 + .../2.1.6/GraphQL/Language/BlockString.html | 393 + api-doc/2.1.6/GraphQL/Language/Cache.html | 312 + .../GraphQL/Language/DefinitionSlice.html | 205 + .../DefinitionSlice/DependencyVisitor.html | 357 + .../DocumentFromSchemaDefinition.html | 2092 +++ .../2.1.6/GraphQL/Language/Generation.html | 288 + api-doc/2.1.6/GraphQL/Language/Lexer.html | 1013 ++ .../GraphQL/Language/Lexer/BadEncoding.html | 291 + .../GraphQL/Language/Lexer/Literals.html | 286 + api-doc/2.1.6/GraphQL/Language/Nodes.html | 303 + .../GraphQL/Language/Nodes/AbstractNode.html | 1436 ++ .../Nodes/AbstractNode/DefinitionNode.html | 274 + .../GraphQL/Language/Nodes/Argument.html | 407 + .../GraphQL/Language/Nodes/Directive.html | 151 + .../Language/Nodes/DirectiveDefinition.html | 237 + .../Language/Nodes/DirectiveLocation.html | 159 + .../GraphQL/Language/Nodes/Document.html | 356 + .../2.1.6/GraphQL/Language/Nodes/Enum.html | 169 + .../Language/Nodes/EnumTypeDefinition.html | 237 + .../Language/Nodes/EnumTypeExtension.html | 151 + .../Language/Nodes/EnumValueDefinition.html | 237 + .../2.1.6/GraphQL/Language/Nodes/Field.html | 424 + .../Language/Nodes/FieldDefinition.html | 313 + .../Language/Nodes/FragmentDefinition.html | 487 + .../Language/Nodes/FragmentSpread.html | 161 + .../Language/Nodes/InlineFragment.html | 161 + .../GraphQL/Language/Nodes/InputObject.html | 357 + .../Nodes/InputObjectTypeDefinition.html | 237 + .../Nodes/InputObjectTypeExtension.html | 151 + .../Language/Nodes/InputValueDefinition.html | 237 + .../Nodes/InterfaceTypeDefinition.html | 237 + .../Nodes/InterfaceTypeExtension.html | 151 + .../GraphQL/Language/Nodes/ListType.html | 169 + .../GraphQL/Language/Nodes/NameOnlyNode.html | 165 + .../GraphQL/Language/Nodes/NonNullType.html | 169 + .../GraphQL/Language/Nodes/NullValue.html | 169 + .../Language/Nodes/ObjectTypeDefinition.html | 237 + .../Language/Nodes/ObjectTypeExtension.html | 151 + .../Language/Nodes/OperationDefinition.html | 416 + .../Language/Nodes/ScalarTypeDefinition.html | 237 + .../Language/Nodes/ScalarTypeExtension.html | 151 + .../Language/Nodes/SchemaDefinition.html | 157 + .../Language/Nodes/SchemaExtension.html | 151 + .../GraphQL/Language/Nodes/TypeName.html | 169 + .../Language/Nodes/UnionTypeDefinition.html | 307 + .../Language/Nodes/UnionTypeExtension.html | 231 + .../Language/Nodes/VariableDefinition.html | 333 + .../Language/Nodes/VariableIdentifier.html | 169 + .../GraphQL/Language/Nodes/WrapperType.html | 165 + api-doc/2.1.6/GraphQL/Language/Parser.html | 359 + api-doc/2.1.6/GraphQL/Language/Printer.html | 334 + .../Language/Printer/TruncatableBuffer.html | 351 + .../TruncateSizeReached.html | 124 + .../GraphQL/Language/SanitizedPrinter.html | 1188 ++ .../2.1.6/GraphQL/Language/StaticVisitor.html | 888 + api-doc/2.1.6/GraphQL/Language/Token.html | 830 + api-doc/2.1.6/GraphQL/Language/Visitor.html | 1170 ++ .../GraphQL/Language/Visitor/DeleteNode.html | 121 + .../LoadApplicationObjectFailedError.html | 610 + api-doc/2.1.6/GraphQL/NameValidator.html | 232 + api-doc/2.1.6/GraphQL/Pagination.html | 117 + .../ActiveRecordRelationConnection.html | 168 + .../GraphQL/Pagination/ArrayConnection.html | 382 + .../2.1.6/GraphQL/Pagination/Connection.html | 2924 +++ .../GraphQL/Pagination/Connection/Edge.html | 482 + .../PaginationImplementationMissingError.html | 132 + .../2.1.6/GraphQL/Pagination/Connections.html | 683 + .../ImplementationMissingError.html | 132 + .../Pagination/MongoidRelationConnection.html | 387 + .../Pagination/RelationConnection.html | 448 + .../Pagination/SequelDatasetConnection.html | 168 + api-doc/2.1.6/GraphQL/ParseError.html | 513 + api-doc/2.1.6/GraphQL/Query.html | 3785 ++++ api-doc/2.1.6/GraphQL/Query/Context.html | 2207 +++ .../Query/Context/ExecutionErrors.html | 284 + .../2.1.6/GraphQL/Query/Context/Scoped.html | 317 + .../GraphQL/Query/Context/ScopedContext.html | 626 + .../GraphQL/Query/Context/SharedMethods.html | 425 + api-doc/2.1.6/GraphQL/Query/Fingerprint.html | 258 + .../GraphQL/Query/InputValidationResult.html | 593 + api-doc/2.1.6/GraphQL/Query/NullContext.html | 611 + .../GraphQL/Query/NullContext/NullQuery.html | 214 + .../GraphQL/Query/NullContext/NullSchema.html | 162 + .../Query/OperationNameMissingError.html | 240 + api-doc/2.1.6/GraphQL/Query/Result.html | 716 + .../GraphQL/Query/ValidationPipeline.html | 731 + .../Query/VariableValidationError.html | 468 + api-doc/2.1.6/GraphQL/Query/Variables.html | 482 + api-doc/2.1.6/GraphQL/Railtie.html | 124 + api-doc/2.1.6/GraphQL/RakeTask.html | 1523 ++ api-doc/2.1.6/GraphQL/Relay.html | 115 + api-doc/2.1.6/GraphQL/Relay/RangeAdd.html | 566 + .../RequiredImplementationMissingError.html | 132 + api-doc/2.1.6/GraphQL/Rubocop.html | 117 + api-doc/2.1.6/GraphQL/Rubocop/GraphQL.html | 117 + .../GraphQL/Rubocop/GraphQL/BaseCop.html | 252 + .../Rubocop/GraphQL/DefaultNullTrue.html | 263 + .../Rubocop/GraphQL/DefaultRequiredTrue.html | 263 + api-doc/2.1.6/GraphQL/Ruby2Keywords.html | 183 + api-doc/2.1.6/GraphQL/RuntimeTypeError.html | 136 + api-doc/2.1.6/GraphQL/Schema.html | 8934 +++++++++ api-doc/2.1.6/GraphQL/Schema/Addition.html | 647 + .../2.1.6/GraphQL/Schema/AlwaysVisible.html | 191 + api-doc/2.1.6/GraphQL/Schema/Argument.html | 2689 +++ .../Argument/InvalidDefaultValueError.html | 214 + .../2.1.6/GraphQL/Schema/Base64Encoder.html | 276 + .../GraphQL/Schema/BuildFromDefinition.html | 310 + .../BuildFromDefinition/ResolveMap.html | 520 + .../ResolveMap/DefaultResolve.html | 341 + .../ResolveMap/NullScalarCoerce.html | 203 + api-doc/2.1.6/GraphQL/Schema/Directive.html | 1691 ++ .../GraphQL/Schema/Directive/Deprecated.html | 303 + .../GraphQL/Schema/Directive/Feature.html | 587 + .../GraphQL/Schema/Directive/Flagged.html | 419 + .../Directive/Flagged/VisibleByFlag.html | 208 + .../GraphQL/Schema/Directive/Include.html | 396 + .../2.1.6/GraphQL/Schema/Directive/OneOf.html | 391 + .../Schema/Directive/OneOf/IsOneOf.html | 198 + .../2.1.6/GraphQL/Schema/Directive/Skip.html | 396 + .../GraphQL/Schema/Directive/SpecifiedBy.html | 303 + .../GraphQL/Schema/Directive/Transform.html | 474 + .../GraphQL/Schema/DuplicateNamesError.html | 298 + api-doc/2.1.6/GraphQL/Schema/Enum.html | 1141 ++ .../Schema/Enum/MissingValuesError.html | 214 + .../Schema/Enum/UnresolvedValueError.html | 224 + api-doc/2.1.6/GraphQL/Schema/EnumValue.html | 897 + api-doc/2.1.6/GraphQL/Schema/Field.html | 5053 ++++++ .../Schema/Field/ConnectionExtension.html | 432 + .../GraphQL/Schema/Field/ExtendedState.html | 489 + .../Field/FieldImplementationFailed.html | 132 + .../Schema/Field/MissingReturnTypeError.html | 132 + .../GraphQL/Schema/Field/ScopeExtension.html | 247 + .../2.1.6/GraphQL/Schema/FieldExtension.html | 1501 ++ .../GraphQL/Schema/FindInheritedValue.html | 110 + api-doc/2.1.6/GraphQL/Schema/Finder.html | 355 + .../Schema/Finder/MemberNotFoundError.html | 124 + .../Schema/HasSingleInputArgument.html | 254 + .../HasSingleInputArgument/ClassMethods.html | 790 + api-doc/2.1.6/GraphQL/Schema/InputObject.html | 1857 ++ api-doc/2.1.6/GraphQL/Schema/Interface.html | 350 + .../Schema/Interface/DefinitionMethods.html | 723 + .../GraphQL/Schema/IntrospectionSystem.html | 767 + .../PerFieldProxyResolve.html | 274 + .../GraphQL/Schema/InvalidDocumentError.html | 142 + .../GraphQL/Schema/InvalidTypeError.html | 132 + .../2.1.6/GraphQL/Schema/LateBoundType.html | 642 + api-doc/2.1.6/GraphQL/Schema/List.html | 739 + api-doc/2.1.6/GraphQL/Schema/Loader.html | 542 + api-doc/2.1.6/GraphQL/Schema/Member.html | 278 + .../GraphQL/Schema/Member/BaseDSLMethods.html | 1062 ++ .../ConfigurationExtension.html | 227 + .../GraphQL/Schema/Member/BuildType.html | 831 + .../Schema/Member/GraphQLTypeNames.html | 202 + .../GraphQL/Schema/Member/HasArguments.html | 1474 ++ .../HasArguments/ArgumentClassAccessor.html | 215 + .../HasArguments/ArgumentObjectLoader.html | 643 + .../Member/HasArguments/ClassConfigured.html | 215 + .../ClassConfigured/InheritedArguments.html | 473 + .../Member/HasArguments/FieldConfigured.html | 425 + .../HasArguments/HasDirectiveArguments.html | 212 + .../GraphQL/Schema/Member/HasAstNode.html | 305 + .../Schema/Member/HasDeprecationReason.html | 223 + .../GraphQL/Schema/Member/HasDirectives.html | 739 + .../GraphQL/Schema/Member/HasFields.html | 777 + .../Member/HasFields/InterfaceMethods.html | 331 + .../Member/HasFields/ObjectMethods.html | 343 + .../GraphQL/Schema/Member/HasInterfaces.html | 547 + .../Member/HasInterfaces/ClassConfigured.html | 219 + .../ClassConfigured/InheritedInterfaces.html | 306 + .../2.1.6/GraphQL/Schema/Member/HasPath.html | 247 + .../Schema/Member/HasUnresolvedTypeError.html | 124 + .../GraphQL/Schema/Member/HasValidators.html | 337 + .../Member/HasValidators/ClassConfigured.html | 215 + .../ClassConfigured/ClassValidators.html | 242 + .../GraphQL/Schema/Member/RelayShortcuts.html | 514 + .../2.1.6/GraphQL/Schema/Member/Scoped.html | 414 + .../Schema/Member/TypeSystemHelpers.html | 708 + .../GraphQL/Schema/Member/ValidatesInput.html | 510 + api-doc/2.1.6/GraphQL/Schema/Mutation.html | 443 + api-doc/2.1.6/GraphQL/Schema/NonNull.html | 850 + api-doc/2.1.6/GraphQL/Schema/NullMask.html | 203 + api-doc/2.1.6/GraphQL/Schema/Object.html | 1213 ++ api-doc/2.1.6/GraphQL/Schema/Printer.html | 846 + .../Schema/Printer/IntrospectionPrinter.html | 210 + .../GraphQL/Schema/RelayClassicMutation.html | 437 + .../GraphQL/Schema/ResolveTypeWithType.html | 225 + api-doc/2.1.6/GraphQL/Schema/Resolver.html | 3079 ++++ .../Schema/Resolver/HasPayloadType.html | 603 + api-doc/2.1.6/GraphQL/Schema/Scalar.html | 736 + .../Schema/SubclassGetReferencesTo.html | 195 + .../2.1.6/GraphQL/Schema/Subscription.html | 1348 ++ api-doc/2.1.6/GraphQL/Schema/Timeout.html | 527 + .../GraphQL/Schema/Timeout/TimeoutError.html | 246 + .../2.1.6/GraphQL/Schema/Timeout/Trace.html | 368 + .../2.1.6/GraphQL/Schema/TypeExpression.html | 273 + .../2.1.6/GraphQL/Schema/TypeMembership.html | 764 + api-doc/2.1.6/GraphQL/Schema/Union.html | 665 + .../GraphQL/Schema/UniqueWithinType.html | 417 + .../Schema/UnresolvedLateBoundTypeError.html | 294 + api-doc/2.1.6/GraphQL/Schema/Validator.html | 1278 ++ .../Schema/Validator/AllowBlankValidator.html | 327 + .../Schema/Validator/AllowNullValidator.html | 335 + .../Schema/Validator/ExclusionValidator.html | 359 + .../Schema/Validator/FormatValidator.html | 394 + .../Schema/Validator/InclusionValidator.html | 361 + .../Schema/Validator/LengthValidator.html | 495 + .../Validator/NumericalityValidator.html | 548 + .../Schema/Validator/RequiredValidator.html | 441 + .../Validator/ValidationFailedError.html | 312 + api-doc/2.1.6/GraphQL/Schema/Warden.html | 2382 +++ .../GraphQL/Schema/Warden/NullWarden.html | 1576 ++ .../GraphQL/Schema/Warden/PassThruWarden.html | 737 + api-doc/2.1.6/GraphQL/Schema/Wrapper.html | 430 + api-doc/2.1.6/GraphQL/StaticValidation.html | 180 + .../ArgumentLiteralsAreCompatible.html | 287 + .../ArgumentLiteralsAreCompatibleError.html | 674 + .../ArgumentNamesAreUnique.html | 319 + .../ArgumentNamesAreUniqueError.html | 432 + .../StaticValidation/ArgumentsAreDefined.html | 211 + .../ArgumentsAreDefinedError.html | 652 + .../GraphQL/StaticValidation/BaseVisitor.html | 646 + .../BaseVisitor/ContextMethods.html | 1060 ++ .../DefinitionDependencies.html | 644 + .../DefinitionDependencies/DependencyMap.html | 563 + .../DefinitionDependencies/NodeWithPath.html | 359 + .../DirectivesAreDefined.html | 258 + .../DirectivesAreDefinedError.html | 432 + .../DirectivesAreInValidLocations.html | 193 + .../DirectivesAreInValidLocationsError.html | 504 + .../2.1.6/GraphQL/StaticValidation/Error.html | 522 + .../StaticValidation/Error/ErrorHelper.html | 204 + .../FieldsAreDefinedOnType.html | 215 + .../FieldsAreDefinedOnTypeError.html | 506 + .../FieldsHaveAppropriateSelections.html | 265 + .../FieldsHaveAppropriateSelectionsError.html | 504 + .../StaticValidation/FieldsWillMerge.html | 331 + .../FieldsWillMerge/Field.html | 474 + .../FieldsWillMerge/FragmentSpread.html | 304 + .../FieldsWillMergeError.html | 728 + .../FragmentNamesAreUnique.html | 303 + .../FragmentNamesAreUniqueError.html | 432 + .../FragmentSpreadsArePossible.html | 382 + .../FragmentSpread.html | 425 + .../FragmentSpreadsArePossibleError.html | 580 + .../StaticValidation/FragmentTypesExist.html | 236 + .../FragmentTypesExistError.html | 432 + .../StaticValidation/FragmentsAreFinite.html | 197 + .../FragmentsAreFiniteError.html | 432 + .../StaticValidation/FragmentsAreNamed.html | 187 + .../FragmentsAreNamedError.html | 348 + .../FragmentsAreOnCompositeTypes.html | 228 + .../FragmentsAreOnCompositeTypesError.html | 502 + .../StaticValidation/FragmentsAreUsed.html | 219 + .../FragmentsAreUsedError.html | 432 + .../InputObjectNamesAreUnique.html | 177 + .../InputObjectNamesAreUniqueError.html | 432 + .../StaticValidation/InterpreterVisitor.html | 174 + .../StaticValidation/LiteralValidator.html | 280 + .../StaticValidation/MutationRootExists.html | 189 + .../MutationRootExistsError.html | 348 + .../NoDefinitionsArePresent.html | 313 + .../NoDefinitionsArePresentError.html | 348 + .../OneOfInputObjectsAreValid.html | 187 + .../OneOfInputObjectsAreValidError.html | 432 + .../OperationNamesAreValid.html | 317 + .../OperationNamesAreValidError.html | 430 + .../StaticValidation/QueryRootExists.html | 189 + .../QueryRootExistsError.html | 348 + .../RequiredArgumentsArePresent.html | 234 + .../RequiredArgumentsArePresentError.html | 580 + ...quiredInputObjectAttributesArePresent.html | 181 + ...dInputObjectAttributesArePresentError.html | 580 + .../SubscriptionRootExists.html | 189 + .../SubscriptionRootExistsError.html | 348 + .../UniqueDirectivesPerLocation.html | 136 + .../UniqueDirectivesPerLocationError.html | 432 + .../StaticValidation/ValidationContext.html | 978 + .../ValidationTimeoutError.html | 348 + .../GraphQL/StaticValidation/Validator.html | 559 + ...ariableDefaultValuesAreCorrectlyTyped.html | 247 + ...leDefaultValuesAreCorrectlyTypedError.html | 597 + .../VariableNamesAreUnique.html | 203 + .../VariableNamesAreUniqueError.html | 432 + .../VariableUsagesAreAllowed.html | 351 + .../VariableUsagesAreAllowedError.html | 654 + .../VariablesAreInputTypes.html | 213 + .../VariablesAreInputTypesError.html | 506 + .../VariablesAreUsedAndDefined.html | 558 + .../VariableUsage.html | 572 + .../VariablesAreUsedAndDefinedError.html | 525 + .../2.1.6/GraphQL/StringEncodingError.html | 462 + api-doc/2.1.6/GraphQL/Subscriptions.html | 1833 ++ .../ActionCableSubscriptions.html | 1067 ++ .../Subscriptions/BroadcastAnalyzer.html | 508 + .../DefaultSubscriptionResolveExtension.html | 340 + .../2.1.6/GraphQL/Subscriptions/Event.html | 798 + .../Subscriptions/Instrumentation.html | 355 + .../Subscriptions/InvalidTriggerError.html | 144 + .../GraphQL/Subscriptions/Serialize.html | 591 + .../SubscriptionScopeMissingError.html | 145 + api-doc/2.1.6/GraphQL/Tracing.html | 135 + .../ActiveSupportNotificationsTrace.html | 208 + .../ActiveSupportNotificationsTracing.html | 224 + .../2.1.6/GraphQL/Tracing/AppOpticsTrace.html | 859 + .../GraphQL/Tracing/AppOpticsTracing.html | 533 + .../2.1.6/GraphQL/Tracing/AppsignalTrace.html | 556 + .../GraphQL/Tracing/AppsignalTracing.html | 473 + .../GraphQL/Tracing/CallLegacyTracers.html | 881 + .../2.1.6/GraphQL/Tracing/DataDogTrace.html | 1082 ++ .../2.1.6/GraphQL/Tracing/DataDogTracing.html | 868 + .../2.1.6/GraphQL/Tracing/LegacyTrace.html | 156 + .../2.1.6/GraphQL/Tracing/NewRelicTrace.html | 621 + .../GraphQL/Tracing/NewRelicTracing.html | 473 + .../GraphQL/Tracing/NotificationsTrace.html | 239 + .../GraphQL/Tracing/NotificationsTracing.html | 422 + api-doc/2.1.6/GraphQL/Tracing/NullTracer.html | 175 + .../2.1.6/GraphQL/Tracing/PlatformTrace.html | 355 + .../Tracing/PlatformTrace/BaseKeyCache.html | 399 + .../GraphQL/Tracing/PlatformTracing.html | 585 + .../GraphQL/Tracing/PrometheusTrace.html | 671 + .../GraphQL/Tracing/PrometheusTracing.html | 475 + .../PrometheusTracing/GraphQLCollector.html | 383 + api-doc/2.1.6/GraphQL/Tracing/ScoutTrace.html | 515 + .../2.1.6/GraphQL/Tracing/ScoutTracing.html | 491 + .../2.1.6/GraphQL/Tracing/StatsdTrace.html | 493 + .../2.1.6/GraphQL/Tracing/StatsdTracing.html | 457 + api-doc/2.1.6/GraphQL/Tracing/Trace.html | 999 ++ api-doc/2.1.6/GraphQL/Tracing/Traceable.html | 262 + api-doc/2.1.6/GraphQL/TypeKinds.html | 150 + api-doc/2.1.6/GraphQL/TypeKinds/TypeKind.html | 1544 ++ api-doc/2.1.6/GraphQL/Types.html | 119 + api-doc/2.1.6/GraphQL/Types/BigInt.html | 449 + api-doc/2.1.6/GraphQL/Types/Boolean.html | 392 + api-doc/2.1.6/GraphQL/Types/Float.html | 392 + api-doc/2.1.6/GraphQL/Types/ID.html | 406 + api-doc/2.1.6/GraphQL/Types/ISO8601Date.html | 515 + .../2.1.6/GraphQL/Types/ISO8601DateTime.html | 724 + .../2.1.6/GraphQL/Types/ISO8601Duration.html | 755 + api-doc/2.1.6/GraphQL/Types/Int.html | 456 + api-doc/2.1.6/GraphQL/Types/JSON.html | 410 + api-doc/2.1.6/GraphQL/Types/Relay.html | 146 + .../GraphQL/Types/Relay/BaseConnection.html | 374 + .../2.1.6/GraphQL/Types/Relay/BaseEdge.html | 354 + .../GraphQL/Types/Relay/ClassMethods.html | 198 + .../Types/Relay/ConnectionBehaviors.html | 337 + .../ConnectionBehaviors/ClassMethods.html | 1157 ++ .../GraphQL/Types/Relay/EdgeBehaviors.html | 196 + .../Relay/EdgeBehaviors/ClassMethods.html | 647 + .../GraphQL/Types/Relay/HasNodeField.html | 272 + .../GraphQL/Types/Relay/HasNodesField.html | 272 + api-doc/2.1.6/GraphQL/Types/Relay/Node.html | 294 + .../GraphQL/Types/Relay/NodeBehaviors.html | 190 + .../Relay/NodeBehaviors/ClassMethods.html | 198 + .../2.1.6/GraphQL/Types/Relay/PageInfo.html | 318 + .../Types/Relay/PageInfoBehaviors.html | 110 + api-doc/2.1.6/GraphQL/Types/String.html | 412 + api-doc/2.1.6/GraphQL/UnauthorizedError.html | 514 + .../2.1.6/GraphQL/UnauthorizedFieldError.html | 344 + .../2.1.6/GraphQL/UnresolvedTypeError.html | 696 + api-doc/2.1.6/Graphql/Generators.html | 119 + api-doc/2.1.6/Graphql/Generators/Core.html | 367 + .../Graphql/Generators/EnumGenerator.html | 163 + .../Graphql/Generators/FieldExtractor.html | 353 + .../Graphql/Generators/InputGenerator.html | 275 + api-doc/2.1.6/Graphql/Generators/Install.html | 115 + .../Install/MutationRootGenerator.html | 216 + .../Graphql/Generators/InstallGenerator.html | 436 + .../Generators/InterfaceGenerator.html | 163 + .../Graphql/Generators/LoaderGenerator.html | 231 + .../Generators/MutationCreateGenerator.html | 170 + .../Generators/MutationDeleteGenerator.html | 170 + .../Graphql/Generators/MutationGenerator.html | 245 + .../Generators/MutationUpdateGenerator.html | 170 + .../Graphql/Generators/ObjectGenerator.html | 277 + .../Graphql/Generators/OrmMutationsBase.html | 250 + api-doc/2.1.6/Graphql/Generators/Relay.html | 292 + .../Graphql/Generators/RelayGenerator.html | 216 + .../Graphql/Generators/ScalarGenerator.html | 162 + .../Graphql/Generators/TypeGeneratorBase.html | 496 + .../TypeGeneratorBase/NormalizedField.html | 317 + .../Graphql/Generators/UnionGenerator.html | 163 + api-doc/2.1.6/Graphql_.html | 117 + api-doc/2.1.6/_index.html | 3462 ++++ api-doc/2.1.6/class_list.html | 51 + api-doc/2.1.6/css/common.css | 1 + api-doc/2.1.6/css/full_list.css | 58 + api-doc/2.1.6/css/style.css | 497 + api-doc/2.1.6/file.readme.html | 125 + api-doc/2.1.6/file_list.html | 56 + api-doc/2.1.6/frames.html | 17 + api-doc/2.1.6/index.html | 125 + api-doc/2.1.6/js/app.js | 314 + api-doc/2.1.6/js/full_list.js | 216 + api-doc/2.1.6/js/jquery.js | 4 + api-doc/2.1.6/method_list.html | 14947 ++++++++++++++++ api-doc/2.1.6/top-level-namespace.html | 110 + 470 files changed, 249654 insertions(+) create mode 100644 api-doc/2.1.6/Base64Bp.html create mode 100644 api-doc/2.1.6/GraphQL.html create mode 100644 api-doc/2.1.6/GraphQL/Analysis.html create mode 100644 api-doc/2.1.6/GraphQL/Analysis/AST.html create mode 100644 api-doc/2.1.6/GraphQL/Analysis/AST/Analyzer.html create mode 100644 api-doc/2.1.6/GraphQL/Analysis/AST/FieldUsage.html create mode 100644 api-doc/2.1.6/GraphQL/Analysis/AST/MaxQueryComplexity.html create mode 100644 api-doc/2.1.6/GraphQL/Analysis/AST/MaxQueryDepth.html create mode 100644 api-doc/2.1.6/GraphQL/Analysis/AST/QueryComplexity.html create mode 100644 api-doc/2.1.6/GraphQL/Analysis/AST/QueryComplexity/ScopedTypeComplexity.html create mode 100644 api-doc/2.1.6/GraphQL/Analysis/AST/QueryDepth.html create mode 100644 api-doc/2.1.6/GraphQL/Analysis/AST/Visitor.html create mode 100644 api-doc/2.1.6/GraphQL/AnalysisError.html create mode 100644 api-doc/2.1.6/GraphQL/Backtrace.html create mode 100644 api-doc/2.1.6/GraphQL/Backtrace/Frame.html create mode 100644 api-doc/2.1.6/GraphQL/Backtrace/InspectResult.html create mode 100644 api-doc/2.1.6/GraphQL/Backtrace/Table.html create mode 100644 api-doc/2.1.6/GraphQL/Backtrace/Trace.html create mode 100644 api-doc/2.1.6/GraphQL/Backtrace/TracedError.html create mode 100644 api-doc/2.1.6/GraphQL/Backtrace/Tracer.html create mode 100644 api-doc/2.1.6/GraphQL/CoercionError.html create mode 100644 api-doc/2.1.6/GraphQL/Dataloader.html create mode 100644 api-doc/2.1.6/GraphQL/Dataloader/NullDataloader.html create mode 100644 api-doc/2.1.6/GraphQL/Dataloader/Request.html create mode 100644 api-doc/2.1.6/GraphQL/Dataloader/RequestAll.html create mode 100644 api-doc/2.1.6/GraphQL/Dataloader/Source.html create mode 100644 api-doc/2.1.6/GraphQL/DateEncodingError.html create mode 100644 api-doc/2.1.6/GraphQL/Deprecation.html create mode 100644 api-doc/2.1.6/GraphQL/Dig.html create mode 100644 api-doc/2.1.6/GraphQL/DurationEncodingError.html create mode 100644 api-doc/2.1.6/GraphQL/EmptyObjects.html create mode 100644 api-doc/2.1.6/GraphQL/Error.html create mode 100644 api-doc/2.1.6/GraphQL/Execution.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/DirectiveChecks.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Errors.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/ArgumentValue.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/Arguments.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/ArgumentsCache.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/ExecutionErrors.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/ListResultFailedError.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/RawValue.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/Resolve.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/CurrentState.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResult.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResultArray.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResultHash.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Lazy.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Lazy/LazyMethodMap.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Lazy/LazyMethodMap/ConcurrentishMap.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Lookahead.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Lookahead/NullLookahead.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Multiplex.html create mode 100644 api-doc/2.1.6/GraphQL/Execution/Skip.html create mode 100644 api-doc/2.1.6/GraphQL/ExecutionError.html create mode 100644 api-doc/2.1.6/GraphQL/IntegerDecodingError.html create mode 100644 api-doc/2.1.6/GraphQL/IntegerEncodingError.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/BaseObject.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/DirectiveLocationEnum.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/DirectiveType.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/DynamicFields.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/EntryPoints.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/EnumValueType.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/FieldType.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/InputValueType.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/SchemaType.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/TypeKindEnum.html create mode 100644 api-doc/2.1.6/GraphQL/Introspection/TypeType.html create mode 100644 api-doc/2.1.6/GraphQL/InvalidNameError.html create mode 100644 api-doc/2.1.6/GraphQL/InvalidNullError.html create mode 100644 api-doc/2.1.6/GraphQL/InvariantError.html create mode 100644 api-doc/2.1.6/GraphQL/Language.html create mode 100644 api-doc/2.1.6/GraphQL/Language/BlockString.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Cache.html create mode 100644 api-doc/2.1.6/GraphQL/Language/DefinitionSlice.html create mode 100644 api-doc/2.1.6/GraphQL/Language/DefinitionSlice/DependencyVisitor.html create mode 100644 api-doc/2.1.6/GraphQL/Language/DocumentFromSchemaDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Generation.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Lexer.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Lexer/BadEncoding.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Lexer/Literals.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/AbstractNode.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/AbstractNode/DefinitionNode.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/Argument.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/Directive.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/DirectiveDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/DirectiveLocation.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/Document.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/Enum.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/EnumTypeDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/EnumTypeExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/EnumValueDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/Field.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/FieldDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/FragmentDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/FragmentSpread.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/InlineFragment.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/InputObject.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/InputObjectTypeDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/InputObjectTypeExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/InputValueDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/InterfaceTypeDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/InterfaceTypeExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/ListType.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/NameOnlyNode.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/NonNullType.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/NullValue.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/ObjectTypeDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/ObjectTypeExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/OperationDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/ScalarTypeDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/ScalarTypeExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/SchemaDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/SchemaExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/TypeName.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/UnionTypeDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/UnionTypeExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/VariableDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/VariableIdentifier.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Nodes/WrapperType.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Parser.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Printer.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Printer/TruncatableBuffer.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Printer/TruncatableBuffer/TruncateSizeReached.html create mode 100644 api-doc/2.1.6/GraphQL/Language/SanitizedPrinter.html create mode 100644 api-doc/2.1.6/GraphQL/Language/StaticVisitor.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Token.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Visitor.html create mode 100644 api-doc/2.1.6/GraphQL/Language/Visitor/DeleteNode.html create mode 100644 api-doc/2.1.6/GraphQL/LoadApplicationObjectFailedError.html create mode 100644 api-doc/2.1.6/GraphQL/NameValidator.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination/ActiveRecordRelationConnection.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination/ArrayConnection.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination/Connection.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination/Connection/Edge.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination/Connection/PaginationImplementationMissingError.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination/Connections.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination/Connections/ImplementationMissingError.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination/MongoidRelationConnection.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination/RelationConnection.html create mode 100644 api-doc/2.1.6/GraphQL/Pagination/SequelDatasetConnection.html create mode 100644 api-doc/2.1.6/GraphQL/ParseError.html create mode 100644 api-doc/2.1.6/GraphQL/Query.html create mode 100644 api-doc/2.1.6/GraphQL/Query/Context.html create mode 100644 api-doc/2.1.6/GraphQL/Query/Context/ExecutionErrors.html create mode 100644 api-doc/2.1.6/GraphQL/Query/Context/Scoped.html create mode 100644 api-doc/2.1.6/GraphQL/Query/Context/ScopedContext.html create mode 100644 api-doc/2.1.6/GraphQL/Query/Context/SharedMethods.html create mode 100644 api-doc/2.1.6/GraphQL/Query/Fingerprint.html create mode 100644 api-doc/2.1.6/GraphQL/Query/InputValidationResult.html create mode 100644 api-doc/2.1.6/GraphQL/Query/NullContext.html create mode 100644 api-doc/2.1.6/GraphQL/Query/NullContext/NullQuery.html create mode 100644 api-doc/2.1.6/GraphQL/Query/NullContext/NullSchema.html create mode 100644 api-doc/2.1.6/GraphQL/Query/OperationNameMissingError.html create mode 100644 api-doc/2.1.6/GraphQL/Query/Result.html create mode 100644 api-doc/2.1.6/GraphQL/Query/ValidationPipeline.html create mode 100644 api-doc/2.1.6/GraphQL/Query/VariableValidationError.html create mode 100644 api-doc/2.1.6/GraphQL/Query/Variables.html create mode 100644 api-doc/2.1.6/GraphQL/Railtie.html create mode 100644 api-doc/2.1.6/GraphQL/RakeTask.html create mode 100644 api-doc/2.1.6/GraphQL/Relay.html create mode 100644 api-doc/2.1.6/GraphQL/Relay/RangeAdd.html create mode 100644 api-doc/2.1.6/GraphQL/RequiredImplementationMissingError.html create mode 100644 api-doc/2.1.6/GraphQL/Rubocop.html create mode 100644 api-doc/2.1.6/GraphQL/Rubocop/GraphQL.html create mode 100644 api-doc/2.1.6/GraphQL/Rubocop/GraphQL/BaseCop.html create mode 100644 api-doc/2.1.6/GraphQL/Rubocop/GraphQL/DefaultNullTrue.html create mode 100644 api-doc/2.1.6/GraphQL/Rubocop/GraphQL/DefaultRequiredTrue.html create mode 100644 api-doc/2.1.6/GraphQL/Ruby2Keywords.html create mode 100644 api-doc/2.1.6/GraphQL/RuntimeTypeError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Addition.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/AlwaysVisible.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Argument.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Argument/InvalidDefaultValueError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Base64Encoder.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap/DefaultResolve.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap/NullScalarCoerce.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive/Deprecated.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive/Feature.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive/Flagged.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive/Flagged/VisibleByFlag.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive/Include.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive/OneOf.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive/OneOf/IsOneOf.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive/Skip.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive/SpecifiedBy.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Directive/Transform.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/DuplicateNamesError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Enum.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Enum/MissingValuesError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Enum/UnresolvedValueError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/EnumValue.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Field.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Field/ConnectionExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Field/ExtendedState.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Field/FieldImplementationFailed.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Field/MissingReturnTypeError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Field/ScopeExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/FieldExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/FindInheritedValue.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Finder.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Finder/MemberNotFoundError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/HasSingleInputArgument.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/HasSingleInputArgument/ClassMethods.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/InputObject.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Interface.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Interface/DefinitionMethods.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/IntrospectionSystem.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/IntrospectionSystem/PerFieldProxyResolve.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/InvalidDocumentError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/InvalidTypeError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/LateBoundType.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/List.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Loader.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/BaseDSLMethods.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/BaseDSLMethods/ConfigurationExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/BuildType.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/GraphQLTypeNames.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasArguments.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ArgumentClassAccessor.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ArgumentObjectLoader.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ClassConfigured.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ClassConfigured/InheritedArguments.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/FieldConfigured.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/HasDirectiveArguments.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasAstNode.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasDeprecationReason.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasDirectives.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasFields.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasFields/InterfaceMethods.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasFields/ObjectMethods.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces/ClassConfigured.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces/ClassConfigured/InheritedInterfaces.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasPath.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasUnresolvedTypeError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasValidators.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasValidators/ClassConfigured.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/HasValidators/ClassConfigured/ClassValidators.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/RelayShortcuts.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/Scoped.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/TypeSystemHelpers.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Member/ValidatesInput.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Mutation.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/NonNull.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/NullMask.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Object.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Printer.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Printer/IntrospectionPrinter.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/RelayClassicMutation.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/ResolveTypeWithType.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Resolver.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Resolver/HasPayloadType.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Scalar.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/SubclassGetReferencesTo.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Subscription.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Timeout.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Timeout/TimeoutError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Timeout/Trace.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/TypeExpression.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/TypeMembership.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Union.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/UniqueWithinType.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/UnresolvedLateBoundTypeError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Validator.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Validator/AllowBlankValidator.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Validator/AllowNullValidator.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Validator/ExclusionValidator.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Validator/FormatValidator.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Validator/InclusionValidator.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Validator/LengthValidator.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Validator/NumericalityValidator.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Validator/RequiredValidator.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Validator/ValidationFailedError.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Warden.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Warden/NullWarden.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Warden/PassThruWarden.html create mode 100644 api-doc/2.1.6/GraphQL/Schema/Wrapper.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/ArgumentLiteralsAreCompatible.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/ArgumentLiteralsAreCompatibleError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/ArgumentNamesAreUnique.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/ArgumentNamesAreUniqueError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/ArgumentsAreDefined.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/ArgumentsAreDefinedError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/BaseVisitor.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/BaseVisitor/ContextMethods.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies/DependencyMap.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies/NodeWithPath.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreDefined.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreDefinedError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreInValidLocations.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreInValidLocationsError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/Error.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/Error/ErrorHelper.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FieldsAreDefinedOnType.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FieldsAreDefinedOnTypeError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FieldsHaveAppropriateSelections.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FieldsHaveAppropriateSelectionsError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge/Field.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge/FragmentSpread.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMergeError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentNamesAreUnique.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentNamesAreUniqueError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossible.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossible/FragmentSpread.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossibleError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentTypesExist.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentTypesExistError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreFinite.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreFiniteError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreNamed.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreNamedError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreOnCompositeTypes.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreOnCompositeTypesError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreUsed.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreUsedError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/InputObjectNamesAreUnique.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/InputObjectNamesAreUniqueError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/InterpreterVisitor.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/LiteralValidator.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/MutationRootExists.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/MutationRootExistsError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/NoDefinitionsArePresent.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/NoDefinitionsArePresentError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/OneOfInputObjectsAreValid.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/OneOfInputObjectsAreValidError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/OperationNamesAreValid.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/OperationNamesAreValidError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/QueryRootExists.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/QueryRootExistsError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/RequiredArgumentsArePresent.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/RequiredArgumentsArePresentError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/RequiredInputObjectAttributesArePresent.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/RequiredInputObjectAttributesArePresentError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/SubscriptionRootExists.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/SubscriptionRootExistsError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/UniqueDirectivesPerLocation.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/UniqueDirectivesPerLocationError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/ValidationContext.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/ValidationTimeoutError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/Validator.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariableDefaultValuesAreCorrectlyTyped.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariableDefaultValuesAreCorrectlyTypedError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariableNamesAreUnique.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariableNamesAreUniqueError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariableUsagesAreAllowed.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariableUsagesAreAllowedError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreInputTypes.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreInputTypesError.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefined.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefined/VariableUsage.html create mode 100644 api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefinedError.html create mode 100644 api-doc/2.1.6/GraphQL/StringEncodingError.html create mode 100644 api-doc/2.1.6/GraphQL/Subscriptions.html create mode 100644 api-doc/2.1.6/GraphQL/Subscriptions/ActionCableSubscriptions.html create mode 100644 api-doc/2.1.6/GraphQL/Subscriptions/BroadcastAnalyzer.html create mode 100644 api-doc/2.1.6/GraphQL/Subscriptions/DefaultSubscriptionResolveExtension.html create mode 100644 api-doc/2.1.6/GraphQL/Subscriptions/Event.html create mode 100644 api-doc/2.1.6/GraphQL/Subscriptions/Instrumentation.html create mode 100644 api-doc/2.1.6/GraphQL/Subscriptions/InvalidTriggerError.html create mode 100644 api-doc/2.1.6/GraphQL/Subscriptions/Serialize.html create mode 100644 api-doc/2.1.6/GraphQL/Subscriptions/SubscriptionScopeMissingError.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/ActiveSupportNotificationsTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/ActiveSupportNotificationsTracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/AppOpticsTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/AppOpticsTracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/AppsignalTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/AppsignalTracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/CallLegacyTracers.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/DataDogTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/DataDogTracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/LegacyTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/NewRelicTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/NewRelicTracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/NotificationsTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/NotificationsTracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/NullTracer.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/PlatformTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/PlatformTrace/BaseKeyCache.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/PlatformTracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/PrometheusTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/PrometheusTracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/PrometheusTracing/GraphQLCollector.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/ScoutTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/ScoutTracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/StatsdTrace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/StatsdTracing.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/Trace.html create mode 100644 api-doc/2.1.6/GraphQL/Tracing/Traceable.html create mode 100644 api-doc/2.1.6/GraphQL/TypeKinds.html create mode 100644 api-doc/2.1.6/GraphQL/TypeKinds/TypeKind.html create mode 100644 api-doc/2.1.6/GraphQL/Types.html create mode 100644 api-doc/2.1.6/GraphQL/Types/BigInt.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Boolean.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Float.html create mode 100644 api-doc/2.1.6/GraphQL/Types/ID.html create mode 100644 api-doc/2.1.6/GraphQL/Types/ISO8601Date.html create mode 100644 api-doc/2.1.6/GraphQL/Types/ISO8601DateTime.html create mode 100644 api-doc/2.1.6/GraphQL/Types/ISO8601Duration.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Int.html create mode 100644 api-doc/2.1.6/GraphQL/Types/JSON.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/BaseConnection.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/BaseEdge.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/ClassMethods.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/ConnectionBehaviors.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/ConnectionBehaviors/ClassMethods.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/EdgeBehaviors.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/EdgeBehaviors/ClassMethods.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/HasNodeField.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/HasNodesField.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/Node.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/NodeBehaviors.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/NodeBehaviors/ClassMethods.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/PageInfo.html create mode 100644 api-doc/2.1.6/GraphQL/Types/Relay/PageInfoBehaviors.html create mode 100644 api-doc/2.1.6/GraphQL/Types/String.html create mode 100644 api-doc/2.1.6/GraphQL/UnauthorizedError.html create mode 100644 api-doc/2.1.6/GraphQL/UnauthorizedFieldError.html create mode 100644 api-doc/2.1.6/GraphQL/UnresolvedTypeError.html create mode 100644 api-doc/2.1.6/Graphql/Generators.html create mode 100644 api-doc/2.1.6/Graphql/Generators/Core.html create mode 100644 api-doc/2.1.6/Graphql/Generators/EnumGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/FieldExtractor.html create mode 100644 api-doc/2.1.6/Graphql/Generators/InputGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/Install.html create mode 100644 api-doc/2.1.6/Graphql/Generators/Install/MutationRootGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/InstallGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/InterfaceGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/LoaderGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/MutationCreateGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/MutationDeleteGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/MutationGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/MutationUpdateGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/ObjectGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/OrmMutationsBase.html create mode 100644 api-doc/2.1.6/Graphql/Generators/Relay.html create mode 100644 api-doc/2.1.6/Graphql/Generators/RelayGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/ScalarGenerator.html create mode 100644 api-doc/2.1.6/Graphql/Generators/TypeGeneratorBase.html create mode 100644 api-doc/2.1.6/Graphql/Generators/TypeGeneratorBase/NormalizedField.html create mode 100644 api-doc/2.1.6/Graphql/Generators/UnionGenerator.html create mode 100644 api-doc/2.1.6/Graphql_.html create mode 100644 api-doc/2.1.6/_index.html create mode 100644 api-doc/2.1.6/class_list.html create mode 100644 api-doc/2.1.6/css/common.css create mode 100644 api-doc/2.1.6/css/full_list.css create mode 100644 api-doc/2.1.6/css/style.css create mode 100644 api-doc/2.1.6/file.readme.html create mode 100644 api-doc/2.1.6/file_list.html create mode 100644 api-doc/2.1.6/frames.html create mode 100644 api-doc/2.1.6/index.html create mode 100644 api-doc/2.1.6/js/app.js create mode 100644 api-doc/2.1.6/js/full_list.js create mode 100644 api-doc/2.1.6/js/jquery.js create mode 100644 api-doc/2.1.6/method_list.html create mode 100644 api-doc/2.1.6/top-level-namespace.html diff --git a/api-doc/2.1.6/Base64Bp.html b/api-doc/2.1.6/Base64Bp.html new file mode 100644 index 0000000000..c9c6afa0a9 --- /dev/null +++ b/api-doc/2.1.6/Base64Bp.html @@ -0,0 +1,290 @@ + + + + + + + Module: Base64Bp + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: Base64Bp + + + Private +

+
+ + + + +
+
Extended by:
+
Base64
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/schema/base_64_bp.rb
+
+ +
+ +

Overview

+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+

backport from ruby v2.5 to v2.2 that has no padding things

+ + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + + +
+

Class Method Details

+ + +
+

+ + .urlsafe_decode64(str) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/schema/base_64_bp.rb', line 19
+
+def urlsafe_decode64(str)
+  str = str.tr("-_", "+/")
+  if !str.end_with?("=") && str.length % 4 != 0
+    str = str.ljust((str.length + 3) & ~3, "=")
+  end
+  strict_decode64(str)
+end
+
+
+ +
+

+ + .urlsafe_encode64(bin, padding:) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+12
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/schema/base_64_bp.rb', line 12
+
+def urlsafe_encode64(bin, padding:)
+  str = strict_encode64(bin)
+  str.tr!("+/", "-_")
+  str.delete!("=") unless padding
+  str
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL.html b/api-doc/2.1.6/GraphQL.html new file mode 100644 index 0000000000..4c2ceecffd --- /dev/null +++ b/api-doc/2.1.6/GraphQL.html @@ -0,0 +1,594 @@ + + + + + + + Module: GraphQL + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql.rb,
+ lib/graphql/dig.rb,
lib/graphql/query.rb,
lib/graphql/schema.rb,
lib/graphql/railtie.rb,
lib/graphql/tracing.rb,
lib/graphql/version.rb,
lib/graphql/language.rb,
lib/graphql/types/id.rb,
lib/graphql/backtrace.rb,
lib/graphql/execution.rb,
lib/graphql/rake_task.rb,
lib/graphql/types/int.rb,
lib/graphql/dataloader.rb,
lib/graphql/type_kinds.rb,
lib/graphql/types/json.rb,
lib/graphql/deprecation.rb,
lib/graphql/parse_error.rb,
lib/graphql/schema/enum.rb,
lib/graphql/schema/list.rb,
lib/graphql/types/float.rb,
lib/graphql/types/relay.rb,
lib/graphql/analysis/ast.rb,
lib/graphql/query/result.rb,
lib/graphql/schema/field.rb,
lib/graphql/schema/union.rb,
lib/graphql/types/string.rb,
lib/graphql/introspection.rb,
lib/graphql/query/context.rb,
lib/graphql/schema/finder.rb,
lib/graphql/schema/loader.rb,
lib/graphql/schema/member.rb,
lib/graphql/schema/object.rb,
lib/graphql/schema/scalar.rb,
lib/graphql/schema/warden.rb,
lib/graphql/subscriptions.rb,
lib/graphql/tracing/trace.rb,
lib/graphql/types/big_int.rb,
lib/graphql/types/boolean.rb,
lib/graphql/analysis_error.rb,
lib/graphql/coercion_error.rb,
lib/graphql/execution/lazy.rb,
lib/graphql/language/cache.rb,
lib/graphql/language/lexer.rb,
lib/graphql/language/nodes.rb,
lib/graphql/language/token.rb,
lib/graphql/name_validator.rb,
lib/graphql/schema/printer.rb,
lib/graphql/schema/timeout.rb,
lib/graphql/schema/wrapper.rb,
lib/graphql/backtrace/table.rb,
lib/graphql/backtrace/trace.rb,
lib/graphql/execution_error.rb,
lib/graphql/language/parser.rb,
lib/graphql/query/variables.rb,
lib/graphql/relay/range_add.rb,
lib/graphql/schema/addition.rb,
lib/graphql/schema/argument.rb,
lib/graphql/schema/mutation.rb,
lib/graphql/schema/non_null.rb,
lib/graphql/schema/resolver.rb,
lib/graphql/backtrace/tracer.rb,
lib/graphql/execution/errors.rb,
lib/graphql/language/printer.rb,
lib/graphql/language/visitor.rb,
lib/graphql/schema/directive.rb,
lib/graphql/schema/interface.rb,
lib/graphql/schema/null_mask.rb,
lib/graphql/schema/validator.rb,
lib/graphql/types/relay/node.rb,
lib/graphql/dataloader/source.rb,
lib/graphql/query/fingerprint.rb,
lib/graphql/schema/enum_value.rb,
lib/graphql/dataloader/request.rb,
lib/graphql/invalid_name_error.rb,
lib/graphql/invalid_null_error.rb,
lib/graphql/query/null_context.rb,
lib/graphql/rake_task/validate.rb,
lib/graphql/runtime_type_error.rb,
lib/graphql/unauthorized_error.rb,
lib/graphql/date_encoding_error.rb,
lib/graphql/execution/lookahead.rb,
lib/graphql/execution/multiplex.rb,
lib/graphql/language/generation.rb,
lib/graphql/schema/input_object.rb,
lib/graphql/schema/subscription.rb,
lib/graphql/subscriptions/event.rb,
lib/graphql/tracing/scout_trace.rb,
lib/graphql/types/iso_8601_date.rb,
lib/graphql/analysis/ast/visitor.rb,
lib/graphql/schema/member/scoped.rb,
lib/graphql/tracing/legacy_trace.rb,
lib/graphql/tracing/statsd_trace.rb,
lib/graphql/analysis/ast/analyzer.rb,
lib/graphql/execution/interpreter.rb,
lib/graphql/language/block_string.rb,
lib/graphql/pagination/connection.rb,
lib/graphql/schema/always_visible.rb,
lib/graphql/schema/built_in_types.rb,
lib/graphql/schema/directive/skip.rb,
lib/graphql/string_encoding_error.rb,
lib/graphql/tracing/scout_tracing.rb,
lib/graphql/types/relay/base_edge.rb,
lib/graphql/types/relay/page_info.rb,
lib/graphql/unresolved_type_error.rb,
lib/graphql/backtrace/traced_error.rb,
lib/graphql/dataloader/request_all.rb,
lib/graphql/integer_decoding_error.rb,
lib/graphql/integer_encoding_error.rb,
lib/graphql/pagination/connections.rb,
lib/graphql/schema/base_64_encoder.rb,
lib/graphql/schema/field_extension.rb,
lib/graphql/schema/late_bound_type.rb,
lib/graphql/schema/member/has_path.rb,
lib/graphql/schema/type_expression.rb,
lib/graphql/schema/type_membership.rb,
lib/graphql/tracing/data_dog_trace.rb,
lib/graphql/tracing/platform_trace.rb,
lib/graphql/tracing/statsd_tracing.rb,
lib/graphql/duration_encoding_error.rb,
lib/graphql/introspection/type_type.rb,
lib/graphql/language/static_visitor.rb,
lib/graphql/schema/directive/one_of.rb,
lib/graphql/static_validation/error.rb,
lib/graphql/subscriptions/serialize.rb,
lib/graphql/tracing/appoptics_trace.rb,
lib/graphql/tracing/appsignal_trace.rb,
lib/graphql/tracing/new_relic_trace.rb,
lib/graphql/types/iso_8601_duration.rb,
lib/graphql/analysis/ast/field_usage.rb,
lib/graphql/analysis/ast/query_depth.rb,
lib/graphql/backtrace/inspect_result.rb,
lib/graphql/introspection/field_type.rb,
lib/graphql/rubocop/graphql/base_cop.rb,
lib/graphql/schema/directive/feature.rb,
lib/graphql/schema/directive/flagged.rb,
lib/graphql/schema/directive/include.rb,
lib/graphql/schema/member/build_type.rb,
lib/graphql/schema/member/has_fields.rb,
lib/graphql/tracing/data_dog_tracing.rb,
lib/graphql/tracing/platform_tracing.rb,
lib/graphql/tracing/prometheus_trace.rb,
lib/graphql/types/iso_8601_date_time.rb,
lib/graphql/unauthorized_field_error.rb,
lib/graphql/introspection/base_object.rb,
lib/graphql/introspection/schema_type.rb,
lib/graphql/language/definition_slice.rb,
lib/graphql/query/validation_pipeline.rb,
lib/graphql/schema/invalid_type_error.rb,
lib/graphql/schema/unique_within_type.rb,
lib/graphql/tracing/appoptics_tracing.rb,
lib/graphql/tracing/appsignal_tracing.rb,
lib/graphql/tracing/new_relic_tracing.rb,
lib/graphql/dataloader/null_dataloader.rb,
lib/graphql/execution/directive_checks.rb,
lib/graphql/introspection/entry_points.rb,
lib/graphql/language/sanitized_printer.rb,
lib/graphql/schema/directive/transform.rb,
lib/graphql/schema/member/has_ast_node.rb,
lib/graphql/tracing/prometheus_tracing.rb,
lib/graphql/types/relay/edge_behaviors.rb,
lib/graphql/types/relay/has_node_field.rb,
lib/graphql/types/relay/node_behaviors.rb,
lib/graphql/pagination/array_connection.rb,
lib/graphql/schema/directive/deprecated.rb,
lib/graphql/schema/find_inherited_value.rb,
lib/graphql/schema/introspection_system.rb,
lib/graphql/schema/member/has_arguments.rb,
lib/graphql/static_validation/all_rules.rb,
lib/graphql/static_validation/validator.rb,
lib/graphql/tracing/notifications_trace.rb,
lib/graphql/types/relay/base_connection.rb,
lib/graphql/types/relay/has_nodes_field.rb,
lib/graphql/analysis/ast/max_query_depth.rb,
lib/graphql/introspection/directive_type.rb,
lib/graphql/introspection/dynamic_fields.rb,
lib/graphql/introspection/type_kind_enum.rb,
lib/graphql/query/context/scoped_context.rb,
lib/graphql/schema/build_from_definition.rb,
lib/graphql/schema/field/scope_extension.rb,
lib/graphql/schema/member/has_directives.rb,
lib/graphql/schema/member/has_interfaces.rb,
lib/graphql/schema/member/has_validators.rb,
lib/graphql/analysis/ast/query_complexity.rb,
lib/graphql/execution/interpreter/resolve.rb,
lib/graphql/execution/interpreter/runtime.rb,
lib/graphql/introspection/enum_value_type.rb,
lib/graphql/query/input_validation_result.rb,
lib/graphql/schema/directive/specified_by.rb,
lib/graphql/schema/member/relay_shortcuts.rb,
lib/graphql/schema/member/validates_input.rb,
lib/graphql/schema/relay_classic_mutation.rb,
lib/graphql/subscriptions/instrumentation.rb,
lib/graphql/tracing/notifications_tracing.rb,
lib/graphql/execution/lazy/lazy_method_map.rb,
lib/graphql/introspection/input_value_type.rb,
lib/graphql/pagination/relation_connection.rb,
lib/graphql/schema/member/base_dsl_methods.rb,
lib/graphql/static_validation/base_visitor.rb,
lib/graphql/execution/interpreter/arguments.rb,
lib/graphql/query/variable_validation_error.rb,
lib/graphql/types/relay/page_info_behaviors.rb,
lib/graphql/schema/has_single_input_argument.rb,
lib/graphql/schema/member/graphql_type_names.rb,
lib/graphql/schema/resolver/has_payload_type.rb,
lib/graphql/subscriptions/broadcast_analyzer.rb,
lib/graphql/types/relay/connection_behaviors.rb,
lib/graphql/analysis/ast/max_query_complexity.rb,
lib/graphql/rubocop/graphql/default_null_true.rb,
lib/graphql/schema/field/connection_extension.rb,
lib/graphql/schema/member/type_system_helpers.rb,
lib/graphql/schema/validator/format_validator.rb,
lib/graphql/schema/validator/length_validator.rb,
lib/graphql/schema/validator/required_validator.rb,
lib/graphql/static_validation/literal_validator.rb,
lib/graphql/execution/interpreter/argument_value.rb,
lib/graphql/load_application_object_failed_error.rb,
lib/graphql/pagination/sequel_dataset_connection.rb,
lib/graphql/schema/member/has_deprecation_reason.rb,
lib/graphql/schema/validator/exclusion_validator.rb,
lib/graphql/schema/validator/inclusion_validator.rb,
lib/graphql/static_validation/validation_context.rb,
lib/graphql/execution/interpreter/arguments_cache.rb,
lib/graphql/introspection/directive_location_enum.rb,
lib/graphql/rubocop/graphql/default_required_true.rb,
lib/graphql/schema/validator/allow_null_validator.rb,
lib/graphql/static_validation/interpreter_visitor.rb,
lib/graphql/execution/interpreter/execution_errors.rb,
lib/graphql/pagination/mongoid_relation_connection.rb,
lib/graphql/schema/validator/allow_blank_validator.rb,
lib/graphql/execution/interpreter/handles_raw_value.rb,
lib/graphql/schema/member/has_unresolved_type_error.rb,
lib/graphql/schema/validator/numericality_validator.rb,
lib/graphql/language/document_from_schema_definition.rb,
lib/graphql/schema/build_from_definition/resolve_map.rb,
lib/graphql/subscriptions/action_cable_subscriptions.rb,
lib/graphql/static_validation/definition_dependencies.rb,
lib/graphql/static_validation/rules/fields_will_merge.rb,
lib/graphql/static_validation/rules/query_root_exists.rb,
lib/graphql/static_validation/rules/fragments_are_used.rb,
lib/graphql/static_validation/validation_timeout_error.rb,
lib/graphql/tracing/active_support_notifications_trace.rb,
lib/graphql/static_validation/rules/fragments_are_named.rb,
lib/graphql/execution/interpreter/runtime/graphql_result.rb,
lib/graphql/pagination/active_record_relation_connection.rb,
lib/graphql/static_validation/rules/fragment_types_exist.rb,
lib/graphql/static_validation/rules/fragments_are_finite.rb,
lib/graphql/static_validation/rules/mutation_root_exists.rb,
lib/graphql/tracing/active_support_notifications_tracing.rb,
lib/graphql/tracing/prometheus_tracing/graphql_collector.rb,
lib/graphql/static_validation/rules/arguments_are_defined.rb,
lib/graphql/static_validation/rules/directives_are_defined.rb,
lib/graphql/static_validation/rules/fields_will_merge_error.rb,
lib/graphql/static_validation/rules/query_root_exists_error.rb,
lib/graphql/static_validation/rules/fragments_are_used_error.rb,
lib/graphql/static_validation/rules/subscription_root_exists.rb,
lib/graphql/static_validation/rules/argument_names_are_unique.rb,
lib/graphql/static_validation/rules/fragment_names_are_unique.rb,
lib/graphql/static_validation/rules/fragments_are_named_error.rb,
lib/graphql/static_validation/rules/operation_names_are_valid.rb,
lib/graphql/static_validation/rules/variable_names_are_unique.rb,
lib/graphql/static_validation/rules/variables_are_input_types.rb,
lib/graphql/static_validation/rules/fields_are_defined_on_type.rb,
lib/graphql/static_validation/rules/fragment_types_exist_error.rb,
lib/graphql/static_validation/rules/fragments_are_finite_error.rb,
lib/graphql/static_validation/rules/mutation_root_exists_error.rb,
lib/graphql/static_validation/rules/no_definitions_are_present.rb,
lib/graphql/static_validation/rules/arguments_are_defined_error.rb,
lib/graphql/static_validation/rules/variable_usages_are_allowed.rb,
lib/graphql/static_validation/rules/directives_are_defined_error.rb,
lib/graphql/subscriptions/default_subscription_resolve_extension.rb,
lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb,
lib/graphql/static_validation/rules/input_object_names_are_unique.rb,
lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb,
lib/graphql/static_validation/rules/required_arguments_are_present.rb,
lib/graphql/static_validation/rules/subscription_root_exists_error.rb,
lib/graphql/static_validation/rules/unique_directives_per_location.rb,
lib/graphql/static_validation/rules/variables_are_used_and_defined.rb,
lib/graphql/static_validation/rules/argument_names_are_unique_error.rb,
lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb,
lib/graphql/static_validation/rules/operation_names_are_valid_error.rb,
lib/graphql/static_validation/rules/variable_names_are_unique_error.rb,
lib/graphql/static_validation/rules/variables_are_input_types_error.rb,
lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb,
lib/graphql/static_validation/rules/argument_literals_are_compatible.rb,
lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb,
lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb,
lib/graphql/static_validation/rules/no_definitions_are_present_error.rb,
lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb,
lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb,
lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb,
lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb,
lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb,
lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb,
lib/graphql/static_validation/rules/required_arguments_are_present_error.rb,
lib/graphql/static_validation/rules/unique_directives_per_location_error.rb,
lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb,
lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb,
lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb,
lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb,
lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb,
lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb,
lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb,
lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb,
lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: Analysis, Deprecation, Dig, EmptyObjects, Execution, Introspection, Language, Pagination, Relay, Rubocop, Ruby2Keywords, StaticValidation, Tracing, TypeKinds, Types + + + + Classes: AnalysisError, Backtrace, CoercionError, Dataloader, DateEncodingError, DurationEncodingError, Error, ExecutionError, IntegerDecodingError, IntegerEncodingError, InvalidNameError, InvalidNullError, InvariantError, LoadApplicationObjectFailedError, NameValidator, ParseError, Query, Railtie, RakeTask, RequiredImplementationMissingError, RuntimeTypeError, Schema, StringEncodingError, Subscriptions, UnauthorizedError, UnauthorizedFieldError, UnresolvedTypeError + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
VERSION = + +
+
"2.1.6"
+ +
+ + + + + +

Class Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + + + +
+

Class Attribute Details

+ + + +
+

+ + .default_parserObject + + + + + +

+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/graphql.rb', line 35
+
+def default_parser
+  @default_parser ||= GraphQL::Language::Parser
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .parse(graphql_string, trace: GraphQL::Tracing::NullTrace) ⇒ GraphQL::Language::Nodes::Document + + + + + +

+
+

Turn a query string or schema definition into an AST

+ + +
+
+
+

Parameters:

+
    + +
  • + + graphql_string + + + (String) + + + + — +

    a GraphQL query string or schema definition

    +
    + +
  • + +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+45
+46
+47
+
+
# File 'lib/graphql.rb', line 45
+
+def self.parse(graphql_string, trace: GraphQL::Tracing::NullTrace)
+  default_parser.parse(graphql_string, trace: trace)
+end
+
+
+ +
+

+ + .parse_file(filename) ⇒ GraphQL::Language::Nodes::Document + + + + + +

+
+

Read the contents of filename and parse them as GraphQL

+ + +
+
+
+

Parameters:

+
    + +
  • + + filename + + + (String) + + + + — +

    Path to a .graphql file containing IDL or query

    +
    + +
  • + +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+52
+53
+54
+55
+
+
# File 'lib/graphql.rb', line 52
+
+def self.parse_file(filename)
+  content = File.read(filename)
+  default_parser.parse(content, filename: filename)
+end
+
+
+ +
+

+ + .parse_with_racc(string, filename: nil, trace: GraphQL::Tracing::NullTrace) ⇒ Object + + + + + +

+ + + + +
+
+
+
+62
+63
+64
+
+
# File 'lib/graphql.rb', line 62
+
+def self.parse_with_racc(string, filename: nil, trace: GraphQL::Tracing::NullTrace)
+  GraphQL::Language::Parser.parse(string, filename: filename, trace: trace)
+end
+
+
+ +
+

+ + .scan(graphql_string) ⇒ Array<Array> + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Array>) + + + +
  • + +
+ +
+ + + + +
+
+
+
+58
+59
+60
+
+
# File 'lib/graphql.rb', line 58
+
+def self.scan(graphql_string)
+  default_parser.scan(graphql_string)
+end
+
+
+ +
+

+ + .scan_with_ruby(graphql_string) ⇒ Object + + + + + +

+ + + + +
+
+
+
+66
+67
+68
+
+
# File 'lib/graphql.rb', line 66
+
+def self.scan_with_ruby(graphql_string)
+  GraphQL::Language::Lexer.tokenize(graphql_string)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Analysis.html b/api-doc/2.1.6/GraphQL/Analysis.html new file mode 100644 index 0000000000..ab5bb3f782 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Analysis.html @@ -0,0 +1,117 @@ + + + + + + + Module: GraphQL::Analysis + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Analysis + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis/ast.rb,
+ lib/graphql/analysis/ast/visitor.rb,
lib/graphql/analysis/ast/analyzer.rb,
lib/graphql/analysis/ast/field_usage.rb,
lib/graphql/analysis/ast/query_depth.rb,
lib/graphql/analysis/ast/max_query_depth.rb,
lib/graphql/analysis/ast/query_complexity.rb,
lib/graphql/analysis/ast/max_query_complexity.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: AST + + + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Analysis/AST.html b/api-doc/2.1.6/GraphQL/Analysis/AST.html new file mode 100644 index 0000000000..e2f674f9dc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Analysis/AST.html @@ -0,0 +1,507 @@ + + + + + + + Module: GraphQL::Analysis::AST + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Analysis::AST + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis/ast/query_depth.rb,
+ lib/graphql/analysis/ast.rb,
lib/graphql/analysis/ast/visitor.rb,
lib/graphql/analysis/ast/analyzer.rb,
lib/graphql/analysis/ast/field_usage.rb,
lib/graphql/analysis/ast/max_query_depth.rb,
lib/graphql/analysis/ast/query_complexity.rb,
lib/graphql/analysis/ast/max_query_complexity.rb
+
+
+ +
+ +

Overview

+
+

Calculate the complexity of a query, using Field#complexity values.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: Analyzer, FieldUsage, MaxQueryComplexity, MaxQueryDepth, QueryComplexity, QueryDepth, Visitor + + +

+ + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .analysis_errors(results) ⇒ Object + + + + + +

+ + + + +
+
+
+
+80
+81
+82
+
+
# File 'lib/graphql/analysis/ast.rb', line 80
+
+def analysis_errors(results)
+  results.flatten.tap { _1.select! { |r| r.is_a?(GraphQL::AnalysisError) } }
+end
+
+
+ +
+

+ + .analyze_multiplex(multiplex, analyzers) ⇒ Array<Any> + + + + + +

+
+

Analyze a multiplex, and all queries within. +Multiplex analyzers are ran for all queries, keeping state. +Query analyzers are ran per query, without carrying state between queries.

+ + +
+
+
+

Parameters:

+ + +

Returns:

+
    + +
  • + + + (Array<Any>) + + + + — +

    Results from multiplex analyzers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/graphql/analysis/ast.rb', line 21
+
+def analyze_multiplex(multiplex, analyzers)
+  multiplex_analyzers = analyzers.map { |analyzer| analyzer.new(multiplex) }
+
+  multiplex.current_trace.analyze_multiplex(multiplex: multiplex) do
+    query_results = multiplex.queries.map do |query|
+      if query.valid?
+        analyze_query(
+          query,
+          query.analyzers,
+          multiplex_analyzers: multiplex_analyzers
+        )
+      else
+        []
+      end
+    end
+
+    multiplex_results = multiplex_analyzers.map(&:result)
+    multiplex_errors = analysis_errors(multiplex_results)
+
+    multiplex.queries.each_with_index do |query, idx|
+      query.analysis_errors = multiplex_errors + analysis_errors(query_results[idx])
+    end
+    multiplex_results
+  end
+end
+
+
+ +
+

+ + .analyze_query(query, analyzers, multiplex_analyzers: []) ⇒ Array<Any> + + + + + +

+
+

Returns Results from those analyzers.

+ + +
+
+
+

Parameters:

+ + +

Returns:

+
    + +
  • + + + (Array<Any>) + + + + — +

    Results from those analyzers

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+
+
# File 'lib/graphql/analysis/ast.rb', line 50
+
+def analyze_query(query, analyzers, multiplex_analyzers: [])
+  query.current_trace.analyze_query(query: query) do
+    query_analyzers = analyzers
+      .map { |analyzer| analyzer.new(query) }
+      .tap { _1.select!(&:analyze?) }
+
+    analyzers_to_run = query_analyzers + multiplex_analyzers
+    if analyzers_to_run.any?
+
+      analyzers_to_run.select!(&:visit?)
+      if analyzers_to_run.any?
+        visitor = GraphQL::Analysis::AST::Visitor.new(
+          query: query,
+          analyzers: analyzers_to_run
+        )
+
+        visitor.visit
+
+        if visitor.rescued_errors.any?
+          return visitor.rescued_errors
+        end
+      end
+
+      query_analyzers.map(&:result)
+    else
+      []
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Analysis/AST/Analyzer.html b/api-doc/2.1.6/GraphQL/Analysis/AST/Analyzer.html new file mode 100644 index 0000000000..d1df650630 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Analysis/AST/Analyzer.html @@ -0,0 +1,497 @@ + + + + + + + Class: GraphQL::Analysis::AST::Analyzer + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Analysis::AST::Analyzer + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis/ast/analyzer.rb
+
+ +
+ +

Overview

+
+

Query analyzer for query ASTs. Query analyzers respond to visitor style methods +but are prefixed by enter and leave.

+ +

When an analyzer is initialized with a Multiplex, you can always get the current query from +visitor.query in the visit methods.

+ + +
+
+
+ + +
+ + + + + + + + +

+ Instance Method Summary + collapse +

+ +
    + +
  • + + + #analyze? ⇒ Boolean + + + + + + + + + + + + + +

    Analyzer hook to decide at analysis time whether a query should be analyzed or not.

    +
    + +
  • + + +
  • + + + #initialize(subject) ⇒ Analyzer + + + + + + + constructor + + + + + + + + +

    A new instance of Analyzer.

    +
    + +
  • + + +
  • + + + #result ⇒ Any + + + + + + + + + + + + + +

    The result for this analyzer.

    +
    + +
  • + + +
  • + + + #visit? ⇒ Boolean + + + + + + + + + + + + + +

    Analyzer hook to decide at analysis time whether analysis requires a visitor pass; can be disabled for precomputed results.

    +
    + +
  • + + +
+ + +
+

Constructor Details

+ +
+

+ + #initialize(subject) ⇒ Analyzer + + + + + +

+
+

Returns a new instance of Analyzer.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
+
# File 'lib/graphql/analysis/ast/analyzer.rb', line 13
+
+def initialize(subject)
+  @subject = subject
+
+  if subject.is_a?(GraphQL::Query)
+    @query = subject
+    @multiplex = nil
+  else
+    @multiplex = subject
+    @query = nil
+  end
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #analyze?Boolean + + + + + +

+
+

Analyzer hook to decide at analysis time whether a query should +be analyzed or not.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    If the query should be analyzed or not

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/analysis/ast/analyzer.rb', line 28
+
+def analyze?
+  true
+end
+
+
+ +
+

+ + #resultAny + + + + + +

+
+

The result for this analyzer. Returning GraphQL::AnalysisError results +in a query error.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Any) + + + + — +

    The analyzer result

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+42
+43
+44
+
+
# File 'lib/graphql/analysis/ast/analyzer.rb', line 42
+
+def result
+  raise GraphQL::RequiredImplementationMissingError
+end
+
+
+ +
+

+ + #visit?Boolean + + + + + +

+
+

Analyzer hook to decide at analysis time whether analysis +requires a visitor pass; can be disabled for precomputed results.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    If analysis requires visitation or not

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/graphql/analysis/ast/analyzer.rb', line 35
+
+def visit?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Analysis/AST/FieldUsage.html b/api-doc/2.1.6/GraphQL/Analysis/AST/FieldUsage.html new file mode 100644 index 0000000000..cb3cd36479 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Analysis/AST/FieldUsage.html @@ -0,0 +1,358 @@ + + + + + + + Class: GraphQL::Analysis::AST::FieldUsage + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Analysis::AST::FieldUsage + + + +

+
+ +
+
Inherits:
+
+ Analyzer + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis/ast/field_usage.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Analyzer

+

#analyze?, #visit?

+
+

Constructor Details

+ +
+

+ + #initialize(query) ⇒ FieldUsage + + + + + +

+
+

Returns a new instance of FieldUsage.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+9
+10
+11
+
+
# File 'lib/graphql/analysis/ast/field_usage.rb', line 6
+
+def initialize(query)
+  super
+  @used_fields = Set.new
+  @used_deprecated_fields = Set.new
+  @used_deprecated_arguments = Set.new
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #on_leave_field(node, parent, visitor) ⇒ Object + + + + + +

+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'lib/graphql/analysis/ast/field_usage.rb', line 13
+
+def on_leave_field(node, parent, visitor)
+  field_defn = visitor.field_definition
+  field = "#{visitor.parent_type_definition.graphql_name}.#{field_defn.graphql_name}"
+  @used_fields << field
+  @used_deprecated_fields << field if field_defn.deprecation_reason
+  arguments = visitor.query.arguments_for(node, visitor.field_definition)
+  # If there was an error when preparing this argument object,
+  # then this might be an error or something:
+  if arguments.respond_to?(:argument_values)
+    extract_deprecated_arguments(arguments.argument_values)
+  end
+end
+
+
+ +
+

+ + #resultObject + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+
+
# File 'lib/graphql/analysis/ast/field_usage.rb', line 26
+
+def result
+  {
+    used_fields: @used_fields.to_a,
+    used_deprecated_fields: @used_deprecated_fields.to_a,
+    used_deprecated_arguments: @used_deprecated_arguments.to_a,
+  }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Analysis/AST/MaxQueryComplexity.html b/api-doc/2.1.6/GraphQL/Analysis/AST/MaxQueryComplexity.html new file mode 100644 index 0000000000..40c7e313e1 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Analysis/AST/MaxQueryComplexity.html @@ -0,0 +1,250 @@ + + + + + + + Class: GraphQL::Analysis::AST::MaxQueryComplexity + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Analysis::AST::MaxQueryComplexity + + + +

+
+ +
+
Inherits:
+
+ QueryComplexity + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis/ast/max_query_complexity.rb
+
+ +
+ +

Overview

+
+

Used under the hood to implement complexity validation, +see Schema#max_complexity and Query#max_complexity

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from QueryComplexity

+

#initialize, #on_enter_field, #on_leave_field

+ + + + + + + + + +

Methods inherited from Analyzer

+

#analyze?, #initialize, #visit?

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Analysis::AST::QueryComplexity

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #resultObject + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/analysis/ast/max_query_complexity.rb', line 8
+
+def result
+  return if subject.max_complexity.nil?
+
+  total_complexity = max_possible_complexity
+
+  if total_complexity > subject.max_complexity
+    GraphQL::AnalysisError.new("Query has complexity of #{total_complexity}, which exceeds max complexity of #{subject.max_complexity}")
+  else
+    nil
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Analysis/AST/MaxQueryDepth.html b/api-doc/2.1.6/GraphQL/Analysis/AST/MaxQueryDepth.html new file mode 100644 index 0000000000..622da5585c --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Analysis/AST/MaxQueryDepth.html @@ -0,0 +1,243 @@ + + + + + + + Class: GraphQL::Analysis::AST::MaxQueryDepth + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Analysis::AST::MaxQueryDepth + + + +

+
+ +
+
Inherits:
+
+ QueryDepth + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis/ast/max_query_depth.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from QueryDepth

+

#initialize, #on_enter_field, #on_leave_field

+ + + + + + + + + +

Methods inherited from Analyzer

+

#analyze?, #initialize, #visit?

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Analysis::AST::QueryDepth

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #resultObject + + + + + +

+ + + + +
+
+
+
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/analysis/ast/max_query_depth.rb', line 6
+
+def result
+  configured_max_depth = if query
+    query.max_depth
+  else
+    multiplex.schema.max_depth
+  end
+
+  if configured_max_depth && @max_depth > configured_max_depth
+    GraphQL::AnalysisError.new("Query has depth of #{@max_depth}, which exceeds max depth of #{configured_max_depth}")
+  else
+    nil
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Analysis/AST/QueryComplexity.html b/api-doc/2.1.6/GraphQL/Analysis/AST/QueryComplexity.html new file mode 100644 index 0000000000..d61ae8f3fc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Analysis/AST/QueryComplexity.html @@ -0,0 +1,452 @@ + + + + + + + Class: GraphQL::Analysis::AST::QueryComplexity + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Analysis::AST::QueryComplexity + + + +

+
+ +
+
Inherits:
+
+ Analyzer + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis/ast/query_complexity.rb
+
+ +
+ +
+

Direct Known Subclasses

+

MaxQueryComplexity

+
+

Defined Under Namespace

+

+ + + + + Classes: ScopedTypeComplexity + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Analyzer

+

#analyze?, #visit?

+
+

Constructor Details

+ +
+

+ + #initialize(query) ⇒ QueryComplexity + + + + + +

+
+

State for the query complexity calculation: +- complexities_on_type holds complexity scores for each type

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+12
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 9
+
+def initialize(query)
+  super
+  @complexities_on_type_by_query = {}
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #on_enter_field(node, parent, visitor) ⇒ Object + + + + + +

+ + + + +
+
+
+
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 61
+
+def on_enter_field(node, parent, visitor)
+  # We don't want to visit fragment definitions,
+  # we'll visit them when we hit the spreads instead
+  return if visitor.visiting_fragment_definition?
+  return if visitor.skipping?
+  parent_type = visitor.parent_type_definition
+  field_key = node.alias || node.name
+  # Find the complexity calculation for this field --
+  # if we're re-entering a selection, we'll already have one.
+  # Otherwise, make a new one and store it.
+  #
+  # `node` and `visitor.field_definition` may appear from a cache,
+  # but I think that's ok. If the arguments _didn't_ match,
+  # then the query would have been rejected as invalid.
+  complexities_on_type = @complexities_on_type_by_query[visitor.query] ||= [ScopedTypeComplexity.new(nil, nil, query, visitor.response_path)]
+
+  complexity = complexities_on_type.last.scoped_children[parent_type][field_key] ||= ScopedTypeComplexity.new(parent_type, visitor.field_definition, visitor.query, visitor.response_path)
+  complexity.nodes.push(node)
+  # Push it on the stack.
+  complexities_on_type.push(complexity)
+end
+
+
+ +
+

+ + #on_leave_field(node, parent, visitor) ⇒ Object + + + + + +

+ + + + +
+
+
+
+83
+84
+85
+86
+87
+88
+89
+90
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 83
+
+def on_leave_field(node, parent, visitor)
+  # We don't want to visit fragment definitions,
+  # we'll visit them when we hit the spreads instead
+  return if visitor.visiting_fragment_definition?
+  return if visitor.skipping?
+  complexities_on_type = @complexities_on_type_by_query[visitor.query]
+  complexities_on_type.pop
+end
+
+
+ +
+

+ + #resultObject + + + + + +

+
+

Overide this method to use the complexity result

+ + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 15
+
+def result
+  max_possible_complexity
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Analysis/AST/QueryComplexity/ScopedTypeComplexity.html b/api-doc/2.1.6/GraphQL/Analysis/AST/QueryComplexity/ScopedTypeComplexity.html new file mode 100644 index 0000000000..37392e5f9d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Analysis/AST/QueryComplexity/ScopedTypeComplexity.html @@ -0,0 +1,823 @@ + + + + + + + Class: GraphQL::Analysis::AST::QueryComplexity::ScopedTypeComplexity + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Analysis::AST::QueryComplexity::ScopedTypeComplexity + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis/ast/query_complexity.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
HASH_CHILDREN = +
+
+

A single proc for #scoped_children hashes. Use this to avoid repeated allocations, +since the lexical binding isn’t important.

+ + +
+
+
+ + +
+
+
->(h, k) { h[k] = {} }
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(parent_type, field_definition, query, response_path) ⇒ ScopedTypeComplexity + + + + + +

+
+

Returns a new instance of ScopedTypeComplexity.

+ + +
+
+
+

Parameters:

+
    + +
  • + + parent_type + + + (Class) + + + + — +

    The owner of field_definition

    +
    + +
  • + +
  • + + field_definition + + + (GraphQL::Field, GraphQL::Schema::Field) + + + + — +

    Used for getting the .complexity configuration

    +
    + +
  • + +
  • + + query + + + (GraphQL::Query) + + + + — +

    Used for query.possible_types

    +
    + +
  • + +
  • + + response_path + + + (Array<String>) + + + + — +

    The path to the response key for the field

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+30
+31
+32
+33
+34
+35
+36
+37
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 30
+
+def initialize(parent_type, field_definition, query, response_path)
+  @parent_type = parent_type
+  @field_definition = field_definition
+  @query = query
+  @response_path = response_path
+  @scoped_children = nil
+  @nodes = []
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #field_definitionObject (readonly) + + + + + +

+
+

Returns the value of attribute field_definition.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 24
+
+def field_definition
+  @field_definition
+end
+
+
+ + + +
+

+ + #nodesArray<GraphQL::Language::Nodes::Field> (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+40
+41
+42
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 40
+
+def nodes
+  @nodes
+end
+
+
+ + + +
+

+ + #queryObject (readonly) + + + + + +

+
+

Returns the value of attribute query.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 24
+
+def query
+  @query
+end
+
+
+ + + +
+

+ + #response_pathObject (readonly) + + + + + +

+
+

Returns the value of attribute response_path.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 24
+
+def response_path
+  @response_path
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #own_complexity(child_complexity) ⇒ Object + + + + + +

+ + + + +
+
+
+
+56
+57
+58
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 56
+
+def own_complexity(child_complexity)
+  @field_definition.calculate_complexity(query: @query, nodes: @nodes, child_complexity: child_complexity)
+end
+
+
+ +
+

+ + #scoped_childrenHash<Hash<Class => ScopedTypeComplexity>] + + + + + +

+
+

This value is only calculated when asked for to avoid needless hash allocations. +Also, if it’s never asked for, we determine that this scope complexity +is a scalar field (#terminal?).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<Hash<Class => ScopedTypeComplexity>]) + + + + — +

    Hash<Hash<Class => ScopedTypeComplexity>]

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+52
+53
+54
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 52
+
+def scoped_children
+  @scoped_children ||= Hash.new(&HASH_CHILDREN)
+end
+
+
+ +
+

+ + #terminal?Boolean + + + + + +

+
+

Returns true if this field has no selections, ie, it’s a scalar. +We need a quick way to check whether we should continue traversing.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'lib/graphql/analysis/ast/query_complexity.rb', line 44
+
+def terminal?
+  @scoped_children.nil?
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Analysis/AST/QueryDepth.html b/api-doc/2.1.6/GraphQL/Analysis/AST/QueryDepth.html new file mode 100644 index 0000000000..68cb83f558 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Analysis/AST/QueryDepth.html @@ -0,0 +1,411 @@ + + + + + + + Class: GraphQL::Analysis::AST::QueryDepth + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Analysis::AST::QueryDepth + + + +

+
+ +
+
Inherits:
+
+ Analyzer + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis/ast/query_depth.rb
+
+ +
+ +
+

Direct Known Subclasses

+

MaxQueryDepth

+
+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Analyzer

+

#analyze?, #visit?

+
+

Constructor Details

+ +
+

+ + #initialize(query) ⇒ QueryDepth + + + + + +

+
+

Returns a new instance of QueryDepth.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+
+
# File 'lib/graphql/analysis/ast/query_depth.rb', line 28
+
+def initialize(query)
+  @max_depth = 0
+  @current_depth = 0
+  @count_introspection_fields = query.schema.count_introspection_fields
+  super
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #on_enter_field(node, parent, visitor) ⇒ Object + + + + + +

+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'lib/graphql/analysis/ast/query_depth.rb', line 35
+
+def on_enter_field(node, parent, visitor)
+  return if visitor.skipping? ||
+    visitor.visiting_fragment_definition? ||
+      (@count_introspection_fields == false && visitor.field_definition.introspection?)
+
+  @current_depth += 1
+end
+
+
+ +
+

+ + #on_leave_field(node, parent, visitor) ⇒ Object + + + + + +

+ + + + +
+
+
+
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
+
# File 'lib/graphql/analysis/ast/query_depth.rb', line 43
+
+def on_leave_field(node, parent, visitor)
+  return if visitor.skipping? ||
+    visitor.visiting_fragment_definition? ||
+    (@count_introspection_fields == false && visitor.field_definition.introspection?)
+
+  if @max_depth < @current_depth
+    @max_depth = @current_depth
+  end
+  @current_depth -= 1
+end
+
+
+ +
+

+ + #resultObject + + + + + +

+ + + + +
+
+
+
+54
+55
+56
+
+
# File 'lib/graphql/analysis/ast/query_depth.rb', line 54
+
+def result
+  @max_depth
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Analysis/AST/Visitor.html b/api-doc/2.1.6/GraphQL/Analysis/AST/Visitor.html new file mode 100644 index 0000000000..5115759ee9 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Analysis/AST/Visitor.html @@ -0,0 +1,1998 @@ + + + + + + + Class: GraphQL::Analysis::AST::Visitor + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Analysis::AST::Visitor + + + +

+
+ +
+
Inherits:
+
+ Language::StaticVisitor + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis/ast/visitor.rb
+
+ +
+ +

Overview

+
+

Depth first traversal through a query AST, calling AST analyzers +along the way.

+ +

The visitor is a special case of GraphQL::Language::StaticVisitor, visiting +only the selected operation, providing helpers for common use cases such +as skipped fields and visiting fragment spreads.

+ + +
+
+
+ + +

See Also:

+
    + +
  • AST Analyzers for queries
  • + +
+ +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Language::StaticVisitor

+

make_visit_methods, #on_argument_children, #on_document_children, #on_field_children, #on_fragment_definition_children, #on_operation_definition_children, #visit_directives, #visit_selections

+
+

Constructor Details

+ +
+

+ + #initialize(query:, analyzers:) ⇒ Visitor + + + + + +

+
+

Returns a new instance of Visitor.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 14
+
+def initialize(query:, analyzers:)
+  @analyzers = analyzers
+  @path = []
+  @object_types = []
+  @directives = []
+  @field_definitions = []
+  @argument_definitions = []
+  @directive_definitions = []
+  @rescued_errors = []
+  @query = query
+  @schema = query.schema
+  @response_path = []
+  @skip_stack = [false]
+  super(query.selected_operation)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #object_typesArray<GraphQL::ObjectType> (readonly) + + + + + +

+
+

Returns Types whose scope we’ve entered.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<GraphQL::ObjectType>) + + + + — +

    Types whose scope we’ve entered

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 34
+
+def object_types
+  @object_types
+end
+
+
+ + + +
+

+ + #queryGraphQL::Query (readonly) + + + + + +

+
+

Returns the query being visited.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Query) + + + + — +

    the query being visited

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 31
+
+def query
+  @query
+end
+
+
+ + + +
+

+ + #rescued_errorsArray<GraphQL::AnalysisError] (readonly) + + + + + +

+
+

Returns Array<GraphQL::AnalysisError].

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 37
+
+def rescued_errors
+  @rescued_errors
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #argument_definitionGraphQL::Argument? + + + + + +

+
+

Returns The most-recently-entered GraphQL::Argument, if currently inside one.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Argument, nil) + + + + — +

    The most-recently-entered GraphQL::Argument, if currently inside one

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+224
+225
+226
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 224
+
+def argument_definition
+  @argument_definitions.last
+end
+
+
+ +
+

+ + #arguments_for(ast_node, field_definition) ⇒ GraphQL::Execution::Interpreter::Arguments + + + + + +

+
+

Returns Arguments for this node, merging default values, literal values and query variables.

+ + +
+
+
+ +

Returns:

+ + +

See Also:

+
    + +
  • GraphQL::Analysis::AST::Visitor.{GraphQL{GraphQL::Query{GraphQL::Query#arguments_for}
  • + +
+ +
+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 48
+
+def arguments_for(ast_node, field_definition)
+  @query.arguments_for(ast_node, field_definition)
+end
+
+
+ +
+

+ + #directive_definitionGraphQL::Directive? + + + + + +

+
+

Returns The most-recently-entered GraphQL::Directive, if currently inside one.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Directive, nil) + + + + — +

    The most-recently-entered GraphQL::Directive, if currently inside one

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+219
+220
+221
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 219
+
+def directive_definition
+  @directive_definitions.last
+end
+
+
+ +
+

+ + #field_definitionGraphQL::Field? + + + + + +

+
+

Returns The most-recently-entered GraphQL::Field, if currently inside one.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Field, nil) + + + + — +

    The most-recently-entered GraphQL::Field, if currently inside one

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+209
+210
+211
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 209
+
+def field_definition
+  @field_definitions.last
+end
+
+
+ +
+

+ + #on_argument(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 163
+
+def on_argument(node, parent)
+  argument_defn = if (arg = @argument_definitions.last)
+    arg_type = arg.type.unwrap
+    if arg_type.kind.input_object?
+      arg_type.get_argument(node.name, @query.context)
+    else
+      nil
+    end
+  elsif (directive_defn = @directive_definitions.last)
+    directive_defn.get_argument(node.name, @query.context)
+  elsif (field_defn = @field_definitions.last)
+    field_defn.get_argument(node.name, @query.context)
+  else
+    nil
+  end
+
+  @argument_definitions.push(argument_defn)
+  @path.push(node.name)
+  call_on_enter_argument(node, parent)
+  super
+  call_on_leave_argument(node, parent)
+  @argument_definitions.pop
+  @path.pop
+end
+
+
+ +
+

+ + #on_directive(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+154
+155
+156
+157
+158
+159
+160
+161
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 154
+
+def on_directive(node, parent)
+  directive_defn = @schema.directives[node.name]
+  @directive_definitions.push(directive_defn)
+  call_on_enter_directive(node, parent)
+  super
+  call_on_leave_directive(node, parent)
+  @directive_definitions.pop
+end
+
+
+ +
+

+ + #on_field(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 127
+
+def on_field(node, parent)
+  @response_path.push(node.alias || node.name)
+  parent_type = @object_types.last
+  # This could be nil if the previous field wasn't found:
+  field_definition = parent_type && @schema.get_field(parent_type, node.name, @query.context)
+  @field_definitions.push(field_definition)
+  if !field_definition.nil?
+    next_object_type = field_definition.type.unwrap
+    @object_types.push(next_object_type)
+  else
+    @object_types.push(nil)
+  end
+  @path.push(node.alias || node.name)
+
+  @skipping = @skip_stack.last || skip?(node)
+  @skip_stack << @skipping
+
+  call_on_enter_field(node, parent)
+  super
+  @skipping = @skip_stack.pop
+  call_on_leave_field(node, parent)
+  @response_path.pop
+  @field_definitions.pop
+  @object_types.pop
+  @path.pop
+end
+
+
+ +
+

+ + #on_fragment_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 107
+
+def on_fragment_definition(node, parent)
+  on_fragment_with_type(node) do
+    @path.push("fragment #{node.name}")
+    @in_fragment_def = false
+    call_on_enter_fragment_definition(node, parent)
+    super
+    @in_fragment_def = false
+    call_on_leave_fragment_definition(node, parent)
+  end
+end
+
+
+ +
+

+ + #on_fragment_spread(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+188
+189
+190
+191
+192
+193
+194
+195
+196
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 188
+
+def on_fragment_spread(node, parent)
+  @path.push("... #{node.name}")
+  call_on_enter_fragment_spread(node, parent)
+  enter_fragment_spread_inline(node)
+  super
+  leave_fragment_spread_inline(node)
+  call_on_leave_fragment_spread(node, parent)
+  @path.pop
+end
+
+
+ +
+

+ + #on_inline_fragment(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+118
+119
+120
+121
+122
+123
+124
+125
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 118
+
+def on_inline_fragment(node, parent)
+  on_fragment_with_type(node) do
+    @path.push("...#{node.type ? " on #{node.type.name}" : ""}")
+    call_on_enter_inline_fragment(node, parent)
+    super
+    call_on_leave_inline_fragment(node, parent)
+  end
+end
+
+
+ +
+

+ + #on_operation_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 96
+
+def on_operation_definition(node, parent)
+  object_type = @schema.root_type_for_operation(node.operation_type)
+  @object_types.push(object_type)
+  @path.push("#{node.operation_type}#{node.name ? " #{node.name}" : ""}")
+  call_on_enter_operation_definition(node, parent)
+  super
+  call_on_leave_operation_definition(node, parent)
+  @object_types.pop
+  @path.pop
+end
+
+
+ +
+

+ + #parent_type_definitionGraphQL::BaseType + + + + + +

+
+

Returns The type which the current type came from.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::BaseType) + + + + — +

    The type which the current type came from

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+204
+205
+206
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 204
+
+def parent_type_definition
+  @object_types[-2]
+end
+
+
+ +
+

+ + #previous_argument_definitionGraphQL::Argument? + + + + + +

+
+

Returns The previous GraphQL argument.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Argument, nil) + + + + — +

    The previous GraphQL argument

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+229
+230
+231
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 229
+
+def previous_argument_definition
+  @argument_definitions[-2]
+end
+
+
+ +
+

+ + #previous_field_definitionGraphQL::Field? + + + + + +

+
+

Returns The GraphQL field which returned the object that the current field belongs to.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Field, nil) + + + + — +

    The GraphQL field which returned the object that the current field belongs to

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+214
+215
+216
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 214
+
+def previous_field_definition
+  @field_definitions[-2]
+end
+
+
+ +
+

+ + #response_pathArray<String> + + + + + +

+
+

Returns The path to the response key for the current field.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<String>) + + + + — +

    The path to the response key for the current field

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+63
+64
+65
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 63
+
+def response_path
+  @response_path.dup
+end
+
+
+ +
+

+ + #skipping?Boolean + + + + + +

+
+

Returns If the current node should be skipped because of a skip or include directive.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    If the current node should be skipped because of a skip or include directive

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+58
+59
+60
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 58
+
+def skipping?
+  @skipping
+end
+
+
+ +
+

+ + #type_definitionGraphQL::BaseType + + + + + +

+
+

Returns The current object type.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::BaseType) + + + + — +

    The current object type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+199
+200
+201
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 199
+
+def type_definition
+  @object_types.last
+end
+
+
+ +
+

+ + #visitObject + + + + + +

+ + + + +
+
+
+
+39
+40
+41
+42
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 39
+
+def visit
+  return unless @document
+  super
+end
+
+
+ +
+

+ + #visiting_fragment_definition?Boolean + + + + + +

+
+

Returns If the visitor is currently inside a fragment definition.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    If the visitor is currently inside a fragment definition

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+53
+54
+55
+
+
# File 'lib/graphql/analysis/ast/visitor.rb', line 53
+
+def visiting_fragment_definition?
+  @in_fragment_def
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/AnalysisError.html b/api-doc/2.1.6/GraphQL/AnalysisError.html new file mode 100644 index 0000000000..16e7912fe1 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/AnalysisError.html @@ -0,0 +1,156 @@ + + + + + + + Exception: GraphQL::AnalysisError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::AnalysisError + + + +

+
+ +
+
Inherits:
+
+ ExecutionError + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/analysis_error.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from ExecutionError

+

#ast_node, #extensions, #options, #path

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from ExecutionError

+

#initialize, #to_h

+ + + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::ExecutionError

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Backtrace.html b/api-doc/2.1.6/GraphQL/Backtrace.html new file mode 100644 index 0000000000..ae3c46a6b6 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Backtrace.html @@ -0,0 +1,441 @@ + + + + + + + Class: GraphQL::Backtrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Backtrace + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + +
+
Includes:
+
Enumerable
+
+ + + + + + +
+
Defined in:
+
lib/graphql/backtrace.rb,
+ lib/graphql/backtrace/table.rb,
lib/graphql/backtrace/trace.rb,
lib/graphql/backtrace/tracer.rb,
lib/graphql/backtrace/traced_error.rb,
lib/graphql/backtrace/inspect_result.rb
+
+
+ +
+ +

Overview

+
+

Wrap unhandled errors with TracedError.

+ +

TracedError provides a GraphQL backtrace with arguments and return values. +The underlying error is available as TracedError#cause.

+ + +
+
+
+ +
+

Examples:

+ + +

toggling backtrace annotation

+

+ +
class MySchema < GraphQL::Schema
+  if Rails.env.development? || Rails.env.test?
+    use GraphQL::Backtrace
+  end
+end
+ +
+ + +

Defined Under Namespace

+

+ + + Modules: InspectResult, Trace, Tracer + + + + Classes: Frame, Table, TracedError + + +

+ + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(context, value: nil) ⇒ Backtrace + + + + + +

+
+

Returns a new instance of Backtrace.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/backtrace.rb', line 30
+
+def initialize(context, value: nil)
+  @table = Table.new(context, value: value)
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .use(schema_defn) ⇒ Object + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/backtrace.rb', line 26
+
+def self.use(schema_defn)
+  schema_defn.trace_with(self::Trace)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #inspectObject + + + + Also known as: + to_s + + + + +

+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'lib/graphql/backtrace.rb', line 34
+
+def inspect
+  @table.to_table
+end
+
+
+ +
+

+ + #to_aObject + + + + + +

+ + + + +
+
+
+
+40
+41
+42
+
+
# File 'lib/graphql/backtrace.rb', line 40
+
+def to_a
+  @table.to_backtrace
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Backtrace/Frame.html b/api-doc/2.1.6/GraphQL/Backtrace/Frame.html new file mode 100644 index 0000000000..54a9b8851b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Backtrace/Frame.html @@ -0,0 +1,759 @@ + + + + + + + Class: GraphQL::Backtrace::Frame + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Backtrace::Frame + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/backtrace.rb
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

Used for internal bookkeeping

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(path:, query:, ast_node:, object:, field:, arguments:, parent_frame:) ⇒ Frame + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of Frame.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+55
+56
+
+
# File 'lib/graphql/backtrace.rb', line 48
+
+def initialize(path:, query:, ast_node:, object:, field:, arguments:, parent_frame:)
+  @path = path
+  @query = query
+  @ast_node = ast_node
+  @field = field
+  @object = object
+  @arguments = arguments
+  @parent_frame = parent_frame
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argumentsObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/backtrace.rb', line 47
+
+def arguments
+  @arguments
+end
+
+
+ + + +
+

+ + #ast_nodeObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/backtrace.rb', line 47
+
+def ast_node
+  @ast_node
+end
+
+
+ + + +
+

+ + #fieldObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/backtrace.rb', line 47
+
+def field
+  @field
+end
+
+
+ + + +
+

+ + #objectObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/backtrace.rb', line 47
+
+def object
+  @object
+end
+
+
+ + + +
+

+ + #parent_frameObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/backtrace.rb', line 47
+
+def parent_frame
+  @parent_frame
+end
+
+
+ + + +
+

+ + #pathObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/backtrace.rb', line 47
+
+def path
+  @path
+end
+
+
+ + + +
+

+ + #queryObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/backtrace.rb', line 47
+
+def query
+  @query
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Backtrace/InspectResult.html b/api-doc/2.1.6/GraphQL/Backtrace/InspectResult.html new file mode 100644 index 0000000000..bfb7bfe781 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Backtrace/InspectResult.html @@ -0,0 +1,296 @@ + + + + + + + Module: GraphQL::Backtrace::InspectResult + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Backtrace::InspectResult + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/backtrace/inspect_result.rb
+
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .inspect_result(obj) ⇒ Object + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/backtrace/inspect_result.rb', line 7
+
+def inspect_result(obj)
+  case obj
+  when Hash
+    "{" +
+      obj.map do |key, val|
+        "#{key}: #{inspect_truncated(val)}"
+      end.join(", ") +
+      "}"
+  when Array
+    "[" +
+      obj.map { |v| inspect_truncated(v) }.join(", ") +
+      "]"
+  when Query::Context::SharedMethods
+    if obj.invalid_null?
+      "nil"
+    else
+      inspect_truncated(obj.value)
+    end
+  else
+    inspect_truncated(obj)
+  end
+end
+
+
+ +
+

+ + .inspect_truncated(obj) ⇒ Object + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
+
# File 'lib/graphql/backtrace/inspect_result.rb', line 30
+
+def inspect_truncated(obj)
+  case obj
+  when Hash
+    "{...}"
+  when Array
+    "[...]"
+  when Query::Context::SharedMethods
+    if obj.invalid_null?
+      "nil"
+    else
+      inspect_truncated(obj.value)
+    end
+  when GraphQL::Execution::Lazy
+    "(unresolved)"
+  else
+    "#{obj.inspect}"
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Backtrace/Table.html b/api-doc/2.1.6/GraphQL/Backtrace/Table.html new file mode 100644 index 0000000000..6905c2951b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Backtrace/Table.html @@ -0,0 +1,421 @@ + + + + + + + Class: GraphQL::Backtrace::Table + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Backtrace::Table + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/backtrace/table.rb
+
+ +
+ +

Overview

+
+

A class for turning a context into a human-readable table or array

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
MIN_COL_WIDTH = + +
+
4
+ +
MAX_COL_WIDTH = + +
+
100
+ +
HEADERS = + +
+
[
+  "Loc",
+  "Field",
+  "Object",
+  "Arguments",
+  "Result",
+]
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(context, value:) ⇒ Table + + + + + +

+
+

Returns a new instance of Table.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+19
+
+
# File 'lib/graphql/backtrace/table.rb', line 16
+
+def initialize(context, value:)
+  @context = context
+  @override_value = value
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #to_backtraceArray<String> + + + + + +

+
+

Returns An array of position + field name entries.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<String>) + + + + — +

    An array of position + field name entries

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+27
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'lib/graphql/backtrace/table.rb', line 27
+
+def to_backtrace
+  @to_backtrace ||= begin
+    backtrace = rows.map { |r| "#{r[0]}: #{r[1]}" }
+    # skip the header entry
+    backtrace.shift
+    backtrace
+  end
+end
+
+
+ +
+

+ + #to_tableString + + + + + +

+
+

Returns A table layout of backtrace with metadata.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    A table layout of backtrace with metadata

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/backtrace/table.rb', line 22
+
+def to_table
+  @to_table ||= render_table(rows)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Backtrace/Trace.html b/api-doc/2.1.6/GraphQL/Backtrace/Trace.html new file mode 100644 index 0000000000..07fb6a3aaa --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Backtrace/Trace.html @@ -0,0 +1,547 @@ + + + + + + + Module: GraphQL::Backtrace::Trace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Backtrace::Trace + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/backtrace/trace.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #analyze_query(query:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/backtrace/trace.rb', line 12
+
+def analyze_query(query:)
+  if query.multiplex # missing for stand-alone static validation
+    push_query_backtrace_context(query)
+  end
+  super
+end
+
+
+ +
+

+ + #execute_field(field:, query:, ast_node:, arguments:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+33
+
+
# File 'lib/graphql/backtrace/trace.rb', line 30
+
+def execute_field(field:, query:, ast_node:, arguments:, object:)
+  push_field_backtrace_context(field, query, ast_node, arguments, object)
+  super
+end
+
+
+ +
+

+ + #execute_field_lazy(field:, query:, ast_node:, arguments:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+35
+36
+37
+38
+
+
# File 'lib/graphql/backtrace/trace.rb', line 35
+
+def execute_field_lazy(field:, query:, ast_node:, arguments:, object:)
+  push_field_backtrace_context(field, query, ast_node, arguments, object)
+  super
+end
+
+
+ +
+

+ + #execute_multiplex(multiplex:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'lib/graphql/backtrace/trace.rb', line 40
+
+def execute_multiplex(multiplex:)
+  super
+rescue StandardError => err
+  # This is an unhandled error from execution,
+  # Re-raise it with a GraphQL trace.
+  multiplex_context = multiplex.context
+  potential_context = multiplex_context[:last_graphql_backtrace_context]
+
+  if potential_context.is_a?(GraphQL::Query::Context) ||
+      potential_context.is_a?(Backtrace::Frame)
+    raise TracedError.new(err, potential_context)
+  else
+    raise
+  end
+ensure
+  multiplex_context = multiplex.context
+  multiplex_context.delete(:graphql_backtrace_contexts)
+  multiplex_context.delete(:last_graphql_backtrace_context)
+end
+
+
+ +
+

+ + #execute_query(query:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+19
+20
+21
+22
+
+
# File 'lib/graphql/backtrace/trace.rb', line 19
+
+def execute_query(query:)
+  push_query_backtrace_context(query)
+  super
+end
+
+
+ +
+

+ + #execute_query_lazy(query:, multiplex:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/backtrace/trace.rb', line 24
+
+def execute_query_lazy(query:, multiplex:)
+  query ||= multiplex.queries.first
+  push_query_backtrace_context(query)
+  super
+end
+
+
+ +
+

+ + #validate(query:, validate:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+
+
# File 'lib/graphql/backtrace/trace.rb', line 5
+
+def validate(query:, validate:)
+  if query.multiplex
+    push_query_backtrace_context(query)
+  end
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Backtrace/TracedError.html b/api-doc/2.1.6/GraphQL/Backtrace/TracedError.html new file mode 100644 index 0000000000..1a21fbff03 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Backtrace/TracedError.html @@ -0,0 +1,490 @@ + + + + + + + Exception: GraphQL::Backtrace::TracedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Backtrace::TracedError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/backtrace/traced_error.rb
+
+ +
+ +

Overview

+
+

When GraphQL::Backtrace is enabled, raised errors are wrapped with TracedError.

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
MESSAGE_TEMPLATE = + +
+
<<-MESSAGE
+Unhandled error during GraphQL execution:
+
+  %{cause_message}
+    %{cause_backtrace}
+    %{cause_backtrace_more}
+Use #cause to access the original exception (including #cause.backtrace).
+
+GraphQL Backtrace:
+%{graphql_table}
+MESSAGE
+ +
CAUSE_BACKTRACE_PREVIEW_LENGTH = +
+
+

This many lines of the original Ruby backtrace +are included in the message

+ + +
+
+
+ + +
+
+
10
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(err, current_ctx) ⇒ TracedError + + + + + +

+
+

Returns a new instance of TracedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
+
# File 'lib/graphql/backtrace/traced_error.rb', line 28
+
+def initialize(err, current_ctx)
+  @context = current_ctx
+  backtrace = Backtrace.new(current_ctx, value: err)
+  @graphql_backtrace = backtrace.to_a
+
+  cause_backtrace_preview = err.backtrace.first(CAUSE_BACKTRACE_PREVIEW_LENGTH).join("\n    ")
+
+  cause_backtrace_remainder_length = err.backtrace.length - CAUSE_BACKTRACE_PREVIEW_LENGTH
+  cause_backtrace_more = if cause_backtrace_remainder_length < 0
+    ""
+  elsif cause_backtrace_remainder_length == 1
+    "... and 1 more line\n"
+  else
+    "... and #{cause_backtrace_remainder_length} more lines\n"
+  end
+
+  message = MESSAGE_TEMPLATE % {
+    cause_message: err.message,
+    cause_backtrace: cause_backtrace_preview,
+    cause_backtrace_more: cause_backtrace_more,
+    graphql_table: backtrace.inspect,
+  }
+  super(message)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #contextGraphQL::Query::Context (readonly) + + + + + +

+
+

Returns The context at the field where the error was raised.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'lib/graphql/backtrace/traced_error.rb', line 10
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #graphql_backtraceArray<String> (readonly) + + + + + +

+
+

Returns Printable backtrace of GraphQL error context.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<String>) + + + + — +

    Printable backtrace of GraphQL error context

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/backtrace/traced_error.rb', line 7
+
+def graphql_backtrace
+  @graphql_backtrace
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Backtrace/Tracer.html b/api-doc/2.1.6/GraphQL/Backtrace/Tracer.html new file mode 100644 index 0000000000..1db0a89698 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Backtrace/Tracer.html @@ -0,0 +1,327 @@ + + + + + + + Module: GraphQL::Backtrace::Tracer + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Backtrace::Tracer + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/backtrace/tracer.rb
+
+ +
+ +

Overview

+
+

TODO this is not fiber-friendly

+ + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .trace(key, metadata) ⇒ Object + + + + + +

+
+

Implement the Tracing API.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'lib/graphql/backtrace/tracer.rb', line 9
+
+def trace(key, )
+  case key
+  when "lex", "parse"
+    # No context here, don't have a query yet
+    nil
+  when "execute_multiplex", "analyze_multiplex"
+    # No query context yet
+    nil
+  when "validate", "analyze_query", "execute_query", "execute_query_lazy"
+    push_key = []
+    if (query = [:query]) || ((queries = [:queries]) && (query = queries.first))
+      push_data = query
+      multiplex = query.multiplex
+    elsif (multiplex = [:multiplex])
+      push_data = multiplex.queries.first
+    end
+  when "execute_field", "execute_field_lazy"
+    query = [:query]
+    multiplex = query.multiplex
+    push_key = query.context[:current_path]
+    parent_frame = multiplex.context[:graphql_backtrace_contexts][push_key[0..-2]]
+
+    if parent_frame.is_a?(GraphQL::Query)
+      parent_frame = parent_frame.context
+    end
+
+    push_data = Frame.new(
+      query: query,
+      path: push_key,
+      ast_node: [:ast_node],
+      field: [:field],
+      object: [:object],
+      arguments: [:arguments],
+      parent_frame: parent_frame,
+    )
+  else
+    # Custom key, no backtrace data for this
+    nil
+  end
+
+  if push_data && multiplex
+    push_storage = multiplex.context[:graphql_backtrace_contexts] ||= {}
+    push_storage[push_key] = push_data
+    multiplex.context[:last_graphql_backtrace_context] = push_data
+  end
+
+  if key == "execute_multiplex"
+    multiplex_context = [:multiplex].context
+    begin
+      yield
+    rescue StandardError => err
+      # This is an unhandled error from execution,
+      # Re-raise it with a GraphQL trace.
+      potential_context = multiplex_context[:last_graphql_backtrace_context]
+
+      if potential_context.is_a?(GraphQL::Query::Context) ||
+          potential_context.is_a?(Backtrace::Frame)
+        raise TracedError.new(err, potential_context)
+      else
+        raise
+      end
+    ensure
+      multiplex_context.delete(:graphql_backtrace_contexts)
+      multiplex_context.delete(:last_graphql_backtrace_context)
+    end
+  else
+    yield
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/CoercionError.html b/api-doc/2.1.6/GraphQL/CoercionError.html new file mode 100644 index 0000000000..a79be4f1fc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/CoercionError.html @@ -0,0 +1,309 @@ + + + + + + + Exception: GraphQL::CoercionError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::CoercionError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/coercion_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, extensions: nil) ⇒ CoercionError + + + + + +

+
+

Returns a new instance of CoercionError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+
+
# File 'lib/graphql/coercion_error.rb', line 8
+
+def initialize(message, extensions: nil)
+  @extensions = extensions
+  super(message)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #extensionsHash + + + + + +

+
+

under the extensions key.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    Optional custom data for error objects which will be added

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/coercion_error.rb', line 6
+
+def extensions
+  @extensions
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Dataloader.html b/api-doc/2.1.6/GraphQL/Dataloader.html new file mode 100644 index 0000000000..1e19541a9c --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Dataloader.html @@ -0,0 +1,1468 @@ + + + + + + + Class: GraphQL::Dataloader + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Dataloader + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/dataloader.rb,
+ lib/graphql/dataloader/source.rb,
lib/graphql/dataloader/request.rb,
lib/graphql/dataloader/request_all.rb,
lib/graphql/dataloader/null_dataloader.rb
+
+
+ +
+ +

Overview

+
+

This plugin supports Fiber-based concurrency, along with Source.

+ + +
+
+
+ +
+

Examples:

+ + +

Installing Dataloader

+

+ +

+class MySchema < GraphQL::Schema
+  use GraphQL::Dataloader
+end
+ + +

Waiting for batch-loaded data in a GraphQL field

+

+ +

+field :team, Types::Team, null: true
+
+def team
+  dataloader.with(Sources::Record, Team).load(object.team_id)
+end
+ +
+ + +
+

Direct Known Subclasses

+

NullDataloader

+
+

Defined Under Namespace

+

+ + + + + Classes: NullDataloader, Request, RequestAll, Source + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
AsyncDataloader = + +
+
Class.new(self) { self.default_nonblocking = true }
+ +
+ + + + + +

Class Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(nonblocking: self.class.default_nonblocking) ⇒ Dataloader + + + + + +

+
+

Returns a new instance of Dataloader.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'lib/graphql/dataloader.rb', line 52
+
+def initialize(nonblocking: self.class.default_nonblocking)
+  @source_cache = Hash.new { |h, k| h[k] = {} }
+  @pending_jobs = []
+  if !nonblocking.nil?
+    @nonblocking = nonblocking
+  end
+end
+
+
+ +
+ +
+

Class Attribute Details

+ + + +
+

+ + .default_nonblockingObject + + + + + +

+
+

Returns the value of attribute default_nonblocking.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/graphql/dataloader.rb', line 27
+
+def default_nonblocking
+  @default_nonblocking
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .use(schema, nonblocking: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+38
+
+
# File 'lib/graphql/dataloader.rb', line 32
+
+def self.use(schema, nonblocking: nil)
+  schema.dataloader_class = if nonblocking
+    AsyncDataloader
+  else
+    self
+  end
+end
+
+
+ +
+

+ + .with_dataloading(&block) ⇒ Object + + + + + +

+
+

Call the block with a Dataloader instance, +then run all enqueued jobs and return the result of the block.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
+
# File 'lib/graphql/dataloader.rb', line 42
+
+def self.with_dataloading(&block)
+  dataloader = self.new
+  result = nil
+  dataloader.append_job {
+    result = block.call(dataloader)
+  }
+  dataloader.run
+  result
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #append_job(&job) ⇒ Object + + + + + +

+
+ + + +
+
+
+ + +
+ + + + +
+
+
+
+126
+127
+128
+129
+130
+131
+
+
# File 'lib/graphql/dataloader.rb', line 126
+
+def append_job(&job)
+  # Given a block, queue it up to be worked through when `#run` is called.
+  # (If the dataloader is already running, than a Fiber will pick this up later.)
+  @pending_jobs.push(job)
+  nil
+end
+
+
+ +
+

+ + #clear_cachevoid + + + + + +

+
+

This method returns an undefined value.

Clear any already-loaded objects from Source caches

+ + +
+
+
+ + +
+ + + + +
+
+
+
+135
+136
+137
+138
+139
+140
+
+
# File 'lib/graphql/dataloader.rb', line 135
+
+def clear_cache
+  @source_cache.each do |_source_class, batched_sources|
+    batched_sources.each_value(&:clear_cache)
+  end
+  nil
+end
+
+
+ +
+

+ + #get_fiber_variablesHash<Symbol, Object> + + + + + +

+
+

This is called before the fiber is spawned, from the parent context (i.e. from +the thread or fiber that it is scheduled from).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<Symbol, Object>) + + + + — +

    Current fiber-local variables

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+
+
# File 'lib/graphql/dataloader.rb', line 68
+
+def get_fiber_variables
+  fiber_vars = {}
+  Thread.current.keys.each do |fiber_var_key|
+    # This variable should be fresh in each new fiber
+    if fiber_var_key != :__graphql_runtime_info
+      fiber_vars[fiber_var_key] = Thread.current[fiber_var_key]
+    end
+  end
+  fiber_vars
+end
+
+
+ +
+

+ + #join_queues(previous_queue, next_queue) ⇒ Object + + + + + +

+ + + + +
+
+
+
+269
+270
+271
+272
+273
+274
+275
+
+
# File 'lib/graphql/dataloader.rb', line 269
+
+def join_queues(previous_queue, next_queue)
+  if @nonblocking
+    Fiber.scheduler.run
+    next_queue.select!(&:alive?)
+  end
+  previous_queue.concat(next_queue)
+end
+
+
+ +
+

+ + #nonblocking?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+60
+61
+62
+
+
# File 'lib/graphql/dataloader.rb', line 60
+
+def nonblocking?
+  @nonblocking
+end
+
+
+ +
+

+ + #runObject + + + + + +

+
+ + + +
+
+
+ + +
+ + + + +
+
+
+
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+
+
# File 'lib/graphql/dataloader.rb', line 171
+
+def run
+  if @nonblocking && !Fiber.scheduler
+    raise "`nonblocking: true` requires `Fiber.scheduler`, assign one with `Fiber.set_scheduler(...)` before executing GraphQL."
+  end
+  # At a high level, the algorithm is:
+  #
+  #  A) Inside Fibers, run jobs from the queue one-by-one
+  #    - When one of the jobs yields to the dataloader (`Fiber.yield`), then that fiber will pause
+  #    - In that case, if there are still pending jobs, a new Fiber will be created to run jobs
+  #    - Continue until all jobs have been _started_ by a Fiber. (Any number of those Fibers may be waiting to be resumed, after their data is loaded)
+  #  B) Once all known jobs have been run until they are complete or paused for data, run all pending data sources.
+  #    - Similarly, create a Fiber to consume pending sources and tell them to load their data.
+  #    - If one of those Fibers pauses, then create a new Fiber to continue working through remaining pending sources.
+  #    - When a source causes another source to become pending, run the newly-pending source _first_, since it's a dependency of the previous one.
+  #  C) After all pending sources have been completely loaded (there are no more pending sources), resume any Fibers that were waiting for data.
+  #    - Those Fibers assume that source caches will have been populated with the data they were waiting for.
+  #    - Those Fibers may request data from a source again, in which case they will yeilded and be added to a new pending fiber list.
+  #  D) Once all pending fibers have been resumed once, return to `A` above.
+  #
+  # For whatever reason, the best implementation I could find was to order the steps `[D, A, B, C]`, with a special case for skipping `D`
+  # on the first pass. I just couldn't find a better way to write the loops in a way that was DRY and easy to read.
+  #
+  pending_fibers = []
+  next_fibers = []
+  pending_source_fibers = []
+  next_source_fibers = []
+  first_pass = true
+
+  while first_pass || (f = pending_fibers.shift)
+    if first_pass
+      first_pass = false
+    else
+      # These fibers were previously waiting for sources to load data,
+      # resume them. (They might wait again, in which case, re-enqueue them.)
+      resume(f)
+      if f.alive?
+        next_fibers << f
+      end
+    end
+
+    while @pending_jobs.any?
+      # Create a Fiber to consume jobs until one of the jobs yields
+      # or jobs run out
+      f = spawn_fiber {
+        while (job = @pending_jobs.shift)
+          job.call
+        end
+      }
+      resume(f)
+      # In this case, the job yielded. Queue it up to run again after
+      # we load whatever it's waiting for.
+      if f.alive?
+        next_fibers << f
+      end
+    end
+
+    if pending_fibers.empty?
+      # Now, run all Sources which have become pending _before_ resuming GraphQL execution.
+      # Sources might queue up other Sources, which is fine -- those will also run before resuming execution.
+      #
+      # This is where an evented approach would be even better -- can we tell which
+      # fibers are ready to continue, and continue execution there?
+      #
+      if (first_source_fiber = create_source_fiber)
+        pending_source_fibers << first_source_fiber
+      end
+
+      while pending_source_fibers.any?
+        while (outer_source_fiber = pending_source_fibers.pop)
+          resume(outer_source_fiber)
+          if outer_source_fiber.alive?
+            next_source_fibers << outer_source_fiber
+          end
+          if (next_source_fiber = create_source_fiber)
+            pending_source_fibers << next_source_fiber
+          end
+        end
+        join_queues(pending_source_fibers, next_source_fibers)
+        next_source_fibers.clear
+      end
+      # Move newly-enqueued Fibers on to the list to be resumed.
+      # Clear out the list of next-round Fibers, so that
+      # any Fibers that pause can be put on it.
+      join_queues(pending_fibers, next_fibers)
+      next_fibers.clear
+    end
+  end
+
+  if @pending_jobs.any?
+    raise "Invariant: #{@pending_jobs.size} pending jobs"
+  elsif pending_fibers.any?
+    raise "Invariant: #{pending_fibers.size} pending fibers"
+  elsif next_fibers.any?
+    raise "Invariant: #{next_fibers.size} next fibers"
+  end
+  nil
+end
+
+
+ +
+

+ + #run_isolatedObject + + + + + +

+
+

Use a self-contained queue for the work in the block.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+
+
# File 'lib/graphql/dataloader.rb', line 143
+
+def run_isolated
+  prev_queue = @pending_jobs
+  prev_pending_keys = {}
+  @source_cache.each do |source_class, batched_sources|
+    batched_sources.each do |batch_args, batched_source_instance|
+      if batched_source_instance.pending?
+        prev_pending_keys[batched_source_instance] = batched_source_instance.pending.dup
+        batched_source_instance.pending.clear
+      end
+    end
+  end
+
+  @pending_jobs = []
+  res = nil
+  # Make sure the block is inside a Fiber, so it can `Fiber.yield`
+  append_job {
+    res = yield
+  }
+  run
+  res
+ensure
+  @pending_jobs = prev_queue
+  prev_pending_keys.each do |source_instance, pending|
+    source_instance.pending.merge!(pending)
+  end
+end
+
+
+ +
+

+ + #set_fiber_variables(vars) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Set up the fiber variables in a new fiber.

+ +

This is called within the fiber, right after it is spawned.

+ + +
+
+
+

Parameters:

+
    + +
  • + + vars + + + (Hash<Symbol, Object>) + + + + — +

    Fiber-local variables from #get_fiber_variables

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+
+
# File 'lib/graphql/dataloader.rb', line 85
+
+def set_fiber_variables(vars)
+  vars.each { |k, v| Thread.current[k] = v }
+  nil
+end
+
+
+ +
+

+ + #with(source_class, *batch_args, **batch_kwargs) ⇒ Object + + + + + +

+
+

truffle-ruby wasn’t doing well with the implementation below

+ + +
+
+
+ + +
+ + + + +
+
+
+
+97
+98
+99
+100
+101
+102
+103
+104
+
+
# File 'lib/graphql/dataloader.rb', line 97
+
+def with(source_class, *batch_args)
+  batch_key = source_class.batch_key_for(*batch_args)
+  @source_cache[source_class][batch_key] ||= begin
+    source = source_class.new(*batch_args)
+    source.setup(self)
+    source
+  end
+end
+
+
+ +
+

+ + #yieldvoid + + + + + +

+
+

This method returns an undefined value.

Tell the dataloader that this fiber is waiting for data.

+ +

Dataloader will resume the fiber after the requested data has been loaded (by another Fiber).

+ + +
+
+
+ + +
+ + + + +
+
+
+
+120
+121
+122
+123
+
+
# File 'lib/graphql/dataloader.rb', line 120
+
+def yield
+  Fiber.yield
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Dataloader/NullDataloader.html b/api-doc/2.1.6/GraphQL/Dataloader/NullDataloader.html new file mode 100644 index 0000000000..743565d18d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Dataloader/NullDataloader.html @@ -0,0 +1,416 @@ + + + + + + + Class: GraphQL::Dataloader::NullDataloader + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Dataloader::NullDataloader + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Dataloader + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/dataloader/null_dataloader.rb
+
+ +
+ +

Overview

+
+

The default implementation of dataloading – all no-ops.

+ +

The Dataloader interface isn’t public, but it enables +simple internal code while adding the option to add Dataloader.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from GraphQL::Dataloader

+

AsyncDataloader

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Dataloader

+

#clear_cache, #get_fiber_variables, #initialize, #join_queues, #nonblocking?, #set_fiber_variables, use, #with, with_dataloading

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Dataloader

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #append_jobObject + + + + + +

+ + + + +
+
+
+
+18
+19
+20
+21
+
+
# File 'lib/graphql/dataloader/null_dataloader.rb', line 18
+
+def append_job
+  yield
+  nil
+end
+
+
+ +
+

+ + #runObject + + + + + +

+
+

These are all no-ops because code was +executed sychronously.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+12
+
+
# File 'lib/graphql/dataloader/null_dataloader.rb', line 12
+
+def run; end
+
+
+ +
+

+ + #run_isolatedObject + + + + + +

+ + + + +
+
+
+
+13
+
+
# File 'lib/graphql/dataloader/null_dataloader.rb', line 13
+
+def run_isolated; yield; end
+
+
+ +
+

+ + #yieldObject + + + + + +

+
+ + + +
+
+
+ +

Raises:

+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/dataloader/null_dataloader.rb', line 14
+
+def yield
+  raise GraphQL::Error, "GraphQL::Dataloader is not running -- add `use GraphQL::Dataloader` to your schema to use Dataloader sources."
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Dataloader/Request.html b/api-doc/2.1.6/GraphQL/Dataloader/Request.html new file mode 100644 index 0000000000..afce93910f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Dataloader/Request.html @@ -0,0 +1,310 @@ + + + + + + + Class: GraphQL::Dataloader::Request + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Dataloader::Request + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/dataloader/request.rb
+
+ +
+ +

Overview

+
+ + + +
+
+
+ + +

See Also:

+ + +
+

Direct Known Subclasses

+

RequestAll

+
+ + + + + + + + +

+ Instance Method Summary + collapse +

+ +
    + +
  • + + + #initialize(source, key) ⇒ Request + + + + + + + constructor + + + + + + + + +

    A new instance of Request.

    +
    + +
  • + + +
  • + + + #load ⇒ Object + + + + + + + + + + + + + +

    Call this method to cause the current Fiber to wait for the results of this request.

    +
    + +
  • + + +
+ + +
+

Constructor Details

+ +
+

+ + #initialize(source, key) ⇒ Request + + + + + +

+
+

Returns a new instance of Request.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+9
+
+
# File 'lib/graphql/dataloader/request.rb', line 6
+
+def initialize(source, key)
+  @source = source
+  @key = key
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #loadObject + + + + + +

+
+

Call this method to cause the current Fiber to wait for the results of this request.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the object loaded for key

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/dataloader/request.rb', line 14
+
+def load
+  @source.load(@key)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Dataloader/RequestAll.html b/api-doc/2.1.6/GraphQL/Dataloader/RequestAll.html new file mode 100644 index 0000000000..25fe6b465c --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Dataloader/RequestAll.html @@ -0,0 +1,314 @@ + + + + + + + Class: GraphQL::Dataloader::RequestAll + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Dataloader::RequestAll + + + +

+
+ +
+
Inherits:
+
+ Request + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/dataloader/request_all.rb
+
+ +
+ +

Overview

+
+ + + +
+
+
+ + +

See Also:

+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(source, keys) ⇒ RequestAll + + + + + +

+
+

Returns a new instance of RequestAll.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+9
+
+
# File 'lib/graphql/dataloader/request_all.rb', line 6
+
+def initialize(source, keys)
+  @source = source
+  @keys = keys
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #loadArray<Object> + + + + + +

+
+

Call this method to cause the current Fiber to wait for the results of this request.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Object>) + + + + — +

    One object for each of keys

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/dataloader/request_all.rb', line 14
+
+def load
+  @source.load_all(@keys)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Dataloader/Source.html b/api-doc/2.1.6/GraphQL/Dataloader/Source.html new file mode 100644 index 0000000000..e1586eb31e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Dataloader/Source.html @@ -0,0 +1,1531 @@ + + + + + + + Class: GraphQL::Dataloader::Source + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Dataloader::Source + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/dataloader/source.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #dataloader ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute dataloader.

    +
    + +
  • + + +
  • + + + #pending ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute pending.

    +
    + +
  • + + +
+ + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #dataloaderObject (readonly) + + + + + +

+
+

Returns the value of attribute dataloader.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/graphql/dataloader/source.rb', line 18
+
+def dataloader
+  @dataloader
+end
+
+
+ + + +
+

+ + #pendingObject (readonly) + + + + + +

+
+

Returns the value of attribute pending.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+171
+172
+173
+
+
# File 'lib/graphql/dataloader/source.rb', line 171
+
+def pending
+  @pending
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .batch_key_for(*batch_args, **batch_kwargs) ⇒ Object + + + + + +

+
+

These arguments are given to dataloader.with(source_class, ...). The object +returned from this method is used to de-duplicate batch loads under the hood +by using it as a Hash key.

+ +

By default, the arguments are all put in an Array. To customize how this source’s +batches are merged, override this method to return something else.

+ +

For example, if you pass ActiveRecord::Relations to .with(...), you could override +this method to call .to_sql on them, thus merging .load(...) calls when they apply +to equivalent relations.

+ + +
+
+
+

Parameters:

+
    + +
  • + + batch_args + + + (Array<Object>) + + + +
  • + +
  • + + batch_kwargs + + + (Hash) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + +
  • + +
+ +
+ + + + +
+
+
+
+160
+161
+162
+
+
# File 'lib/graphql/dataloader/source.rb', line 160
+
+def self.batch_key_for(*batch_args, **batch_kwargs)
+  [*batch_args, **batch_kwargs]
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #clear_cachevoid + + + + + +

+
+

This method returns an undefined value.

Clear any already-loaded objects for this source

+ + +
+
+
+ + +
+ + + + +
+
+
+
+166
+167
+168
+169
+
+
# File 'lib/graphql/dataloader/source.rb', line 166
+
+def clear_cache
+  @results.clear
+  nil
+end
+
+
+ +
+

+ + #fetch(keys) ⇒ Array<Object> + + + + + +

+
+

Subclasses must implement this method to return a value for each of keys

+ + +
+
+
+

Parameters:

+ + +

Returns:

+
    + +
  • + + + (Array<Object>) + + + + — +

    A loaded value for each of keys. The array must match one-for-one to the list of keys.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+86
+87
+88
+89
+
+
# File 'lib/graphql/dataloader/source.rb', line 86
+
+def fetch(keys)
+  # somehow retrieve these from the backend
+  raise "Implement `#{self.class}#fetch(#{keys.inspect}) to return a record for each of the keys"
+end
+
+
+ +
+

+ + #load(value) ⇒ Object + + + + + +

+
+

Returns The result from #fetch for key. If key hasn’t been loaded yet, the Fiber will yield until it’s loaded.

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +

    A loading value which will be passed to #fetch if it isn’t already in the internal cache.

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The result from #fetch for key. If key hasn’t been loaded yet, the Fiber will yield until it’s loaded.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
+
# File 'lib/graphql/dataloader/source.rb', line 51
+
+def load(value)
+  result_key = result_key_for(value)
+  if @results.key?(result_key)
+    result_for(result_key)
+  else
+    @pending[result_key] ||= value
+    sync([result_key])
+    result_for(result_key)
+  end
+end
+
+
+ +
+

+ + #load_all(values) ⇒ Object + + + + + +

+
+

Returns The result from #fetch for keys. If keys haven’t been loaded yet, the Fiber will yield until they’re loaded.

+ + +
+
+
+

Parameters:

+
    + +
  • + + values + + + (Array<Object>) + + + + — +

    Loading keys which will be passed to #fetch (or read from the internal cache).

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The result from #fetch for keys. If keys haven’t been loaded yet, the Fiber will yield until they’re loaded.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+
+
# File 'lib/graphql/dataloader/source.rb', line 64
+
+def load_all(values)
+  result_keys = []
+  pending_keys = []
+  values.each { |v|
+    k = result_key_for(v)
+    result_keys << k
+    if !@results.key?(k)
+      @pending[k] ||= v
+      pending_keys << k
+    end
+  }
+
+  if pending_keys.any?
+    sync(pending_keys)
+  end
+
+  result_keys.map { |k| result_for(k) }
+end
+
+
+ +
+

+ + #merge(new_results) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Add these key-value pairs to this source’s cache +(future loads will use these merged values).

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_results + + + (Hash<Object => Object>) + + + + — +

    key-value pairs to cache in this source

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+116
+117
+118
+119
+120
+121
+122
+
+
# File 'lib/graphql/dataloader/source.rb', line 116
+
+def merge(new_results)
+  new_results.each do |new_k, new_v|
+    key = result_key_for(new_k)
+    @results[key] = new_v
+  end
+  nil
+end
+
+
+ +
+

+ + #pending?Boolean + + + + + +

+
+

Returns True if this source has any pending requests for data.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if this source has any pending requests for data.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+108
+109
+110
+
+
# File 'lib/graphql/dataloader/source.rb', line 108
+
+def pending?
+  !@pending.empty?
+end
+
+
+ +
+

+ + #request(value) ⇒ Dataloader::Request + + + + + +

+
+

Returns a pending request for a value from key. Call .load on that object to wait for the result.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Dataloader::Request) + + + + — +

    a pending request for a value from key. Call .load on that object to wait for the result.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+
+
# File 'lib/graphql/dataloader/source.rb', line 21
+
+def request(value)
+  res_key = result_key_for(value)
+  if !@results.key?(res_key)
+    @pending[res_key] ||= value
+  end
+  Dataloader::Request.new(self, value)
+end
+
+
+ +
+

+ + #request_all(values) ⇒ Dataloader::Request + + + + + +

+
+

Returns a pending request for a values from keys. Call .load on that object to wait for the results.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Dataloader::Request) + + + + — +

    a pending request for a values from keys. Call .load on that object to wait for the results.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
+
# File 'lib/graphql/dataloader/source.rb', line 39
+
+def request_all(values)
+  values.each do |v|
+    res_key = result_key_for(v)
+    if !@results.key?(res_key)
+      @pending[res_key] ||= v
+    end
+  end
+  Dataloader::RequestAll.new(self, values)
+end
+
+
+ +
+

+ + #result_key_for(value) ⇒ Object + + + + + +

+
+

Implement this method to return a stable identifier if different +key objects should load the same data value.

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +

    A value passed to .request or .load, for which a value will be loaded

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The key for tracking this pending data

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'lib/graphql/dataloader/source.rb', line 34
+
+def result_key_for(value)
+  value
+end
+
+
+ +
+

+ + #run_pending_keysvoid + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This method returns an undefined value.

Called by GraphQL::Dataloader to resolve and pending requests to this source.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+
+
# File 'lib/graphql/dataloader/source.rb', line 127
+
+def run_pending_keys
+  if !@fetching.empty?
+    @fetching.each_key { |k| @pending.delete(k) }
+  end
+  return if @pending.empty?
+  fetch_h = @pending
+  @pending = {}
+  @fetching.merge!(fetch_h)
+  results = fetch(fetch_h.values)
+  fetch_h.each_with_index do |(key, _value), idx|
+    @results[key] = results[idx]
+  end
+  nil
+rescue StandardError => error
+  fetch_h.each_key { |key| @results[key] = error }
+ensure
+  fetch_h && fetch_h.each_key { |k| @fetching.delete(k) }
+end
+
+
+ +
+

+ + #setup(dataloader) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Called by GraphQL::Dataloader to prepare the GraphQL::Dataloader::Source’s internal state

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
+
# File 'lib/graphql/dataloader/source.rb', line 8
+
+def setup(dataloader)
+  # These keys have been requested but haven't been fetched yet
+  @pending = {}
+  # These keys have been passed to `fetch` but haven't been finished yet
+  @fetching = {}
+  # { key => result }
+  @results = {}
+  @dataloader = dataloader
+end
+
+
+ +
+

+ + #sync(pending_result_keys) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Wait for a batch, if there’s anything to batch. +Then run the batch and update the cache.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+
+
# File 'lib/graphql/dataloader/source.rb', line 94
+
+def sync(pending_result_keys)
+  @dataloader.yield
+  iterations = 0
+  while pending_result_keys.any? { |key| !@results.key?(key) }
+    iterations += 1
+    if iterations > 1000
+      raise "#{self.class}#sync tried 1000 times to load pending keys (#{pending_result_keys}), but they still weren't loaded. There is likely a circular dependency."
+    end
+    @dataloader.yield
+  end
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/DateEncodingError.html b/api-doc/2.1.6/GraphQL/DateEncodingError.html new file mode 100644 index 0000000000..6bba5a0b70 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/DateEncodingError.html @@ -0,0 +1,320 @@ + + + + + + + Exception: GraphQL::DateEncodingError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::DateEncodingError + + + +

+
+ +
+
Inherits:
+
+ RuntimeTypeError + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/date_encoding_error.rb
+
+ +
+ +

Overview

+
+

This error is raised when Types::ISO8601Date is asked to return a value +that cannot be parsed to a Ruby Date.

+ + +
+
+
+ + +

See Also:

+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #date_value ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    The value which couldn’t be encoded.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(value) ⇒ DateEncodingError + + + + + +

+
+

Returns a new instance of DateEncodingError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+
+
# File 'lib/graphql/date_encoding_error.rb', line 11
+
+def initialize(value)
+  @date_value = value
+  super("Date cannot be parsed: #{value}. \nDate must be be able to be parsed as a Ruby Date object.")
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #date_valueObject (readonly) + + + + + +

+
+

The value which couldn’t be encoded

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/date_encoding_error.rb', line 9
+
+def date_value
+  @date_value
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Deprecation.html b/api-doc/2.1.6/GraphQL/Deprecation.html new file mode 100644 index 0000000000..86e40cd0f0 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Deprecation.html @@ -0,0 +1,175 @@ + + + + + + + Module: GraphQL::Deprecation + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Deprecation + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/deprecation.rb
+
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .warn(message) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/deprecation.rb', line 5
+
+def self.warn(message)
+  Kernel.warn(message)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Dig.html b/api-doc/2.1.6/GraphQL/Dig.html new file mode 100644 index 0000000000..c03ba9b17b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Dig.html @@ -0,0 +1,234 @@ + + + + + + + Module: GraphQL::Dig + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Dig + + + +

+
+ + + + + + + + + +
+
Included in:
+
Execution::Interpreter::Arguments, Schema::InputObject
+
+ + + +
+
Defined in:
+
lib/graphql/dig.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ +
    + +
  • + + + #dig(own_key, *rest_keys) ⇒ Object + + + + + + + + + + + + + +

    implemented using the old activesupport #dig instead of the ruby built-in so we can use some of the magic in Schema::InputObject and Interpreter::Arguments to handle stringified/symbolized keys.

    +
    + +
  • + + +
+ + + + +
+

Instance Method Details

+ + +
+

+ + #dig(own_key, *rest_keys) ⇒ Object + + + + + +

+
+

implemented using the old activesupport #dig instead of the ruby built-in +so we can use some of the magic in Schema::InputObject and Interpreter::Arguments +to handle stringified/symbolized keys.

+ + +
+
+
+

Parameters:

+
    + +
  • + + args + + + (Array<[String, Symbol>] Retrieves the value object corresponding to the each key objects repeatedly) + + + + — +

    rgs [Array<[String, Symbol>] Retrieves the value object corresponding to the each key objects repeatedly

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + +
  • + +
+ +
+ + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/dig.rb', line 10
+
+def dig(own_key, *rest_keys)
+  val = self[own_key]
+  if val.nil? || rest_keys.empty?
+    val
+  else
+    val.dig(*rest_keys)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/DurationEncodingError.html b/api-doc/2.1.6/GraphQL/DurationEncodingError.html new file mode 100644 index 0000000000..c417fdf3c9 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/DurationEncodingError.html @@ -0,0 +1,320 @@ + + + + + + + Exception: GraphQL::DurationEncodingError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::DurationEncodingError + + + +

+
+ +
+
Inherits:
+
+ RuntimeTypeError + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/duration_encoding_error.rb
+
+ +
+ +

Overview

+
+

This error is raised when Types::ISO8601Duration is asked to return a value +that cannot be parsed as an ISO8601-formatted duration by ActiveSupport::Duration.

+ + +
+
+
+ + +

See Also:

+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #duration_value ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    The value which couldn’t be encoded.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(value) ⇒ DurationEncodingError + + + + + +

+
+

Returns a new instance of DurationEncodingError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+
+
# File 'lib/graphql/duration_encoding_error.rb', line 11
+
+def initialize(value)
+  @duration_value = value
+  super("Duration cannot be parsed: #{value}. \nDuration must be an ISO8601-formatted duration.")
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #duration_valueObject (readonly) + + + + + +

+
+

The value which couldn’t be encoded

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/duration_encoding_error.rb', line 9
+
+def duration_value
+  @duration_value
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/EmptyObjects.html b/api-doc/2.1.6/GraphQL/EmptyObjects.html new file mode 100644 index 0000000000..92a09d3257 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/EmptyObjects.html @@ -0,0 +1,131 @@ + + + + + + + Module: GraphQL::EmptyObjects + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::EmptyObjects + + + +

+
+ + + + + + + + + +
+
Included in:
+
Schema::Argument, Schema::Field, Schema::Member::HasValidators, Schema::Member::HasValidators::ClassConfigured::ClassValidators, Schema::Validator
+
+ + + +
+
Defined in:
+
lib/graphql.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
EMPTY_HASH = + +
+
{}.freeze
+ +
EMPTY_ARRAY = + +
+
[].freeze
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Error.html b/api-doc/2.1.6/GraphQL/Error.html new file mode 100644 index 0000000000..23fb1ccafd --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Error.html @@ -0,0 +1,128 @@ + + + + + + + Exception: GraphQL::Error + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution.html b/api-doc/2.1.6/GraphQL/Execution.html new file mode 100644 index 0000000000..757fea4935 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution.html @@ -0,0 +1,149 @@ + + + + + + + Module: GraphQL::Execution + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Execution + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution.rb,
+ lib/graphql/execution/lazy.rb,
lib/graphql/execution/errors.rb,
lib/graphql/execution/lookahead.rb,
lib/graphql/execution/multiplex.rb,
lib/graphql/execution/interpreter.rb,
lib/graphql/execution/directive_checks.rb,
lib/graphql/execution/interpreter/resolve.rb,
lib/graphql/execution/interpreter/runtime.rb,
lib/graphql/execution/lazy/lazy_method_map.rb,
lib/graphql/execution/interpreter/arguments.rb,
lib/graphql/execution/interpreter/argument_value.rb,
lib/graphql/execution/interpreter/arguments_cache.rb,
lib/graphql/execution/interpreter/execution_errors.rb,
lib/graphql/execution/interpreter/handles_raw_value.rb,
lib/graphql/execution/interpreter/runtime/graphql_result.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: DirectiveChecks + + + + Classes: Errors, Interpreter, Lazy, Lookahead, Multiplex, Skip + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
SKIP = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+

Just a singleton for implementing Query::Context::SharedMethods#skip

+ + +
+
+
+ + +
+
+
Skip.new
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/DirectiveChecks.html b/api-doc/2.1.6/GraphQL/Execution/DirectiveChecks.html new file mode 100644 index 0000000000..e50c8684bd --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/DirectiveChecks.html @@ -0,0 +1,306 @@ + + + + + + + Module: GraphQL::Execution::DirectiveChecks + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Execution::DirectiveChecks + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/directive_checks.rb
+
+ +
+ +

Overview

+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+

Boolean checks for how an AST node’s directives should +influence its execution

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
SKIP = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"skip"
+ +
INCLUDE = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"include"
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .include?(directive_ast_nodes, query) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Should this node be included in the query?.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Should this node be included in the query?

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'lib/graphql/execution/directive_checks.rb', line 14
+
+def include?(directive_ast_nodes, query)
+  directive_ast_nodes.each do |directive_ast_node|
+    name = directive_ast_node.name
+    directive_defn = query.schema.directives[name]
+    case name
+    when SKIP
+      args = query.arguments_for(directive_ast_node, directive_defn)
+      if args[:if] == true
+        return false
+      end
+    when INCLUDE
+      args = query.arguments_for(directive_ast_node, directive_defn)
+      if args[:if] == false
+        return false
+      end
+    else
+      # Undefined directive, or one we don't care about
+    end
+  end
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Errors.html b/api-doc/2.1.6/GraphQL/Execution/Errors.html new file mode 100644 index 0000000000..78b0a3921a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Errors.html @@ -0,0 +1,459 @@ + + + + + + + Class: GraphQL::Execution::Errors + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Errors + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/errors.rb
+
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .find_handler_for(schema, error_class) ⇒ Proc? + + + + + +

+
+

Returns The handler for error_class, if one was registered on this schema or inherited.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Proc, nil) + + + + — +

    The handler for error_class, if one was registered on this schema or inherited

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+
+
# File 'lib/graphql/execution/errors.rb', line 56
+
+def self.find_handler_for(schema, error_class)
+  handlers = schema.error_handlers[:subclass_handlers]
+  handler = nil
+  while (handlers) do
+    _err_class, next_handler = handlers.find { |err_class, handler| error_class <= err_class }
+    if next_handler
+      handlers = next_handler[:subclass_handlers]
+      handler = next_handler
+    else
+      # Don't reassign `handler` --
+      # let the previous assignment carry over outside this block.
+      break
+    end
+  end
+
+  # check for a handler from a parent class:
+  if schema.superclass.respond_to?(:error_handlers)
+    parent_handler = find_handler_for(schema.superclass, error_class)
+  end
+
+  # If the inherited handler is more specific than the one defined here,
+  # use it.
+  # If it's a tie (or there is no parent handler), use the one defined here.
+  # If there's an inherited one, but not one defined here, use the inherited one.
+  # Otherwise, there's no handler for this error, return `nil`.
+  if parent_handler && handler && parent_handler[:class] < handler[:class]
+    parent_handler
+  elsif handler
+    handler
+  elsif parent_handler
+    parent_handler
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + .register_rescue_from(error_class, error_handlers, error_handler) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Register this handler, updating the +internal handler index to maintain least-to-most specific.

+ + +
+
+
+

Parameters:

+
    + +
  • + + error_class + + + (Class<Exception>) + + + +
  • + +
  • + + error_handlers + + + (Hash) + + + +
  • + +
  • + + error_handler + + + (Proc) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
+
# File 'lib/graphql/execution/errors.rb', line 13
+
+def self.register_rescue_from(error_class, error_handlers, error_handler)
+  subclasses_handlers = {}
+  this_level_subclasses = []
+  # During this traversal, do two things:
+  # - Identify any already-registered subclasses of this error class
+  #   and gather them up to be inserted _under_ this class
+  # - Find the point in the index where this handler should be inserted
+  #   (That is, _under_ any superclasses, or at top-level, if there are no superclasses registered)
+  while (error_handlers) do
+    this_level_subclasses.clear
+    # First, identify already-loaded handlers that belong
+    # _under_ this one. (That is, they're handlers
+    # for subclasses of `error_class`.)
+    error_handlers.each do |err_class, handler|
+      if err_class < error_class
+        subclasses_handlers[err_class] = handler
+        this_level_subclasses << err_class
+      end
+    end
+    # Any handlers that we'll be moving, delete them from this point in the index
+    this_level_subclasses.each do |err_class|
+      error_handlers.delete(err_class)
+    end
+
+    # See if any keys in this hash are superclasses of this new class:
+    next_index_point = error_handlers.find { |err_class, handler| error_class < err_class }
+    if next_index_point
+      error_handlers = next_index_point[1][:subclass_handlers]
+    else
+      # this new handler doesn't belong to any sub-handlers,
+      # so insert it in the current set of `handlers`
+      break
+    end
+  end
+  # Having found the point at which to insert this handler,
+  # register it and merge any subclass handlers back in at this point.
+  this_class_handlers = error_handlers[error_class]
+  this_class_handlers[:handler] = error_handler
+  this_class_handlers[:subclass_handlers].merge!(subclasses_handlers)
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter.html new file mode 100644 index 0000000000..b6bd4d2db2 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter.html @@ -0,0 +1,564 @@ + + + + + + + Class: GraphQL::Execution::Interpreter + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Interpreter + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter.rb,
+ lib/graphql/execution/interpreter/resolve.rb,
lib/graphql/execution/interpreter/runtime.rb,
lib/graphql/execution/interpreter/arguments.rb,
lib/graphql/execution/interpreter/argument_value.rb,
lib/graphql/execution/interpreter/arguments_cache.rb,
lib/graphql/execution/interpreter/execution_errors.rb,
lib/graphql/execution/interpreter/handles_raw_value.rb,
lib/graphql/execution/interpreter/runtime/graphql_result.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: Resolve + + + + Classes: ArgumentValue, Arguments, ArgumentsCache, ExecutionErrors, ListResultFailedError, RawValue, Runtime + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
NO_OPERATION = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+

Used internally to signal that the query shouldn’t be executed

+ + +
+
+
+ + +
+
+
GraphQL::EmptyObjects::EMPTY_HASH
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .run_all(schema, query_options, context: {}, max_complexity: schema.max_complexity) ⇒ Array<Hash> + + + + + +

+
+

Returns One result per query.

+ + +
+
+
+

Parameters:

+
    + +
  • + + schema + + + (GraphQL::Schema) + + + +
  • + +
  • + + queries + + + (Array<GraphQL::Query, Hash>) + + + +
  • + +
  • + + context + + + (Hash) + + + (defaults to: {}) + + +
  • + +
  • + + max_complexity + + + (Integer, nil) + + + (defaults to: schema.max_complexity) + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array<Hash>) + + + + — +

    One result per query

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+
+
# File 'lib/graphql/execution/interpreter.rb', line 24
+
+def run_all(schema, query_options, context: {}, max_complexity: schema.max_complexity)
+  queries = query_options.map do |opts|
+    case opts
+    when Hash
+      GraphQL::Query.new(schema, nil, **opts)
+    when GraphQL::Query
+      opts
+    else
+      raise "Expected Hash or GraphQL::Query, not #{opts.class} (#{opts.inspect})"
+    end
+  end
+
+  multiplex = Execution::Multiplex.new(schema: schema, queries: queries, context: context, max_complexity: max_complexity)
+  multiplex.current_trace.execute_multiplex(multiplex: multiplex) do
+    schema = multiplex.schema
+    queries = multiplex.queries
+    query_instrumenters = schema.instrumenters[:query]
+    multiplex_instrumenters = schema.instrumenters[:multiplex]
+    lazies_at_depth = Hash.new { |h, k| h[k] = [] }
+
+    # First, run multiplex instrumentation, then query instrumentation for each query
+    call_hooks(multiplex_instrumenters, multiplex, :before_multiplex, :after_multiplex) do
+      each_query_call_hooks(query_instrumenters, queries) do
+        schema = multiplex.schema
+        multiplex_analyzers = schema.multiplex_analyzers
+        queries = multiplex.queries
+        if multiplex.max_complexity
+          multiplex_analyzers += [GraphQL::Analysis::AST::MaxQueryComplexity]
+        end
+
+        schema.analysis_engine.analyze_multiplex(multiplex, multiplex_analyzers)
+        begin
+          # Since this is basically the batching context,
+          # share it for a whole multiplex
+          multiplex.context[:interpreter_instance] ||= multiplex.schema.query_execution_strategy.new
+          # Do as much eager evaluation of the query as possible
+          results = []
+          queries.each_with_index do |query, idx|
+            multiplex.dataloader.append_job {
+              operation = query.selected_operation
+              result = if operation.nil? || !query.valid? || query.context.errors.any?
+                NO_OPERATION
+              else
+                begin
+                  # Although queries in a multiplex _share_ an Interpreter instance,
+                  # they also have another item of state, which is private to that query
+                  # in particular, assign it here:
+                  runtime = Runtime.new(query: query, lazies_at_depth: lazies_at_depth)
+                  query.context.namespace(:interpreter_runtime)[:runtime] = runtime
+
+                  query.current_trace.execute_query(query: query) do
+                    runtime.run_eager
+                  end
+                rescue GraphQL::ExecutionError => err
+                  query.context.errors << err
+                  NO_OPERATION
+                end
+              end
+              results[idx] = result
+            }
+          end
+
+          multiplex.dataloader.run
+
+          # Then, work through lazy results in a breadth-first way
+          multiplex.dataloader.append_job {
+            query = multiplex.queries.length == 1 ? multiplex.queries[0] : nil
+            queries = multiplex ? multiplex.queries : [query]
+            final_values = queries.map do |query|
+              runtime = query.context.namespace(:interpreter_runtime)[:runtime]
+              # it might not be present if the query has an error
+              runtime ? runtime.final_result : nil
+            end
+            final_values.compact!
+            multiplex.current_trace.execute_query_lazy(multiplex: multiplex, query: query) do
+              Interpreter::Resolve.resolve_each_depth(lazies_at_depth, multiplex.dataloader)
+            end
+          }
+          multiplex.dataloader.run
+
+          # Then, find all errors and assign the result to the query object
+          results.each_with_index do |data_result, idx|
+            query = queries[idx]
+            # Assign the result so that it can be accessed in instrumentation
+            query.result_values = if data_result.equal?(NO_OPERATION)
+              if !query.valid? || query.context.errors.any?
+                # A bit weird, but `Query#static_errors` _includes_ `query.context.errors`
+                { "errors" => query.static_errors.map(&:to_h) }
+              else
+                data_result
+              end
+            else
+              result = {
+                "data" => query.context.namespace(:interpreter_runtime)[:runtime].final_result
+              }
+
+              if query.context.errors.any?
+                error_result = query.context.errors.map(&:to_h)
+                result["errors"] = error_result
+              end
+
+              result
+            end
+            if query.context.namespace?(:__query_result_extensions__)
+              query.result_values["extensions"] = query.context.namespace(:__query_result_extensions__)
+            end
+            # Get the Query::Result, not the Hash
+            results[idx] = query.result
+          end
+
+          results
+        rescue Exception
+          # TODO rescue at a higher level so it will catch errors in analysis, too
+          # Assign values here so that the query's `@executed` becomes true
+          queries.map { |q| q.result_values ||= {} }
+          raise
+        ensure
+          queries.map { |query|
+            runtime = query.context.namespace(:interpreter_runtime)[:runtime]
+            if runtime
+              runtime.delete_all_interpreter_context
+            end
+          }
+        end
+      end
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/ArgumentValue.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/ArgumentValue.html new file mode 100644 index 0000000000..b66c23d648 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/ArgumentValue.html @@ -0,0 +1,492 @@ + + + + + + + Class: GraphQL::Execution::Interpreter::ArgumentValue + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Interpreter::ArgumentValue + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter/argument_value.rb
+
+ +
+ +

Overview

+
+

A container for metadata regarding arguments present in a GraphQL query.

+ + +
+
+
+ + +

See Also:

+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(definition:, value:, default_used:) ⇒ ArgumentValue + + + + + +

+
+

Returns a new instance of ArgumentValue.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+12
+13
+
+
# File 'lib/graphql/execution/interpreter/argument_value.rb', line 9
+
+def initialize(definition:, value:, default_used:)
+  @definition = definition
+  @value = value
+  @default_used = default_used
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #definitionGraphQL::Schema::Argument (readonly) + + + + + +

+
+

Returns The definition instance for this argument.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/execution/interpreter/argument_value.rb', line 19
+
+def definition
+  @definition
+end
+
+
+ + + +
+

+ + #valueObject (readonly) + + + + + +

+
+

Returns The Ruby-ready value for this Argument.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The Ruby-ready value for this Argument

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/execution/interpreter/argument_value.rb', line 16
+
+def value
+  @value
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #default_used?Boolean + + + + + +

+
+

Returns true if the schema-defined default_value: was applied in this case. (No client-provided value was present.).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    true if the schema-defined default_value: was applied in this case. (No client-provided value was present.)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/execution/interpreter/argument_value.rb', line 22
+
+def default_used?
+  @default_used
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/Arguments.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Arguments.html new file mode 100644 index 0000000000..1281e2d5ee --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Arguments.html @@ -0,0 +1,761 @@ + + + + + + + Class: GraphQL::Execution::Interpreter::Arguments + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Interpreter::Arguments + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + +
+
Includes:
+
Dig
+
+ + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter/arguments.rb
+
+ +
+ +

Overview

+
+

A wrapper for argument hashes in GraphQL queries.

+ +

This object is immutable so that the runtime code can be sure that +modifications don’t leak from one use to another

+ + +
+
+
+ + +

See Also:

+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
NO_ARGS = + +
+
GraphQL::EmptyObjects::EMPTY_HASH
+ +
EMPTY = + +
+
self.new(argument_values: nil, keyword_arguments: NO_ARGS).freeze
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + +

Methods included from Dig

+

#dig

+
+

Constructor Details

+ +
+

+ + #initialize(keyword_arguments: nil, argument_values:) ⇒ Arguments + + + + + +

+
+

Returns a new instance of Arguments.

+ + +
+
+
+

Parameters:

+
    + +
  • + + argument_values + + + (nil, Hash{Symbol => ArgumentValue}) + + + +
  • + +
  • + + keyword_arguments + + + (nil, Hash{Symbol => Object}) + + + (defaults to: nil) + + +
  • + +
+ + +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
+
# File 'lib/graphql/execution/interpreter/arguments.rb', line 24
+
+def initialize(keyword_arguments: nil, argument_values:)
+  @empty = argument_values.nil? || argument_values.empty?
+  # This is only present when `extras` have been merged in:
+  if keyword_arguments
+    # This is a little crazy. We expect the `:argument_details` extra to _include extras_,
+    # but the object isn't created until _after_ extras are put together.
+    # So, we have to use a special flag here to say, "at the last minute, add yourself to the keyword args."
+    #
+    # Otherwise:
+    # - We can't access the final Arguments instance _while_ we're preparing extras
+    # - After we _can_ access it, it's frozen, so we can't add anything.
+    #
+    # So, this flag gives us a chance to sneak it in before freezing, _and_ while we have access
+    # to the new Arguments instance itself.
+    if keyword_arguments[:argument_details] == :__arguments_add_self
+      keyword_arguments[:argument_details] = self
+    end
+    @keyword_arguments = keyword_arguments.freeze
+  elsif !@empty
+    @keyword_arguments = {}
+    argument_values.each do |name, arg_val|
+      @keyword_arguments[name] = arg_val.value
+    end
+    @keyword_arguments.freeze
+  else
+    @keyword_arguments = NO_ARGS
+  end
+  @argument_values = argument_values ? argument_values.freeze : NO_ARGS
+  freeze
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argument_valuesHash{Symbol => ArgumentValue} (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+56
+57
+58
+
+
# File 'lib/graphql/execution/interpreter/arguments.rb', line 56
+
+def argument_values
+  @argument_values
+end
+
+
+ + + +
+

+ + #keyword_argumentsHash<Symbol, Object> (readonly) + + + + + +

+
+

The Ruby-style arguments hash, ready for a resolver. +This hash is the one used at runtime.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<Symbol, Object>) + + + +
  • + +
+ +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/execution/interpreter/arguments.rb', line 20
+
+def keyword_arguments
+  @keyword_arguments
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #empty?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+58
+59
+60
+
+
# File 'lib/graphql/execution/interpreter/arguments.rb', line 58
+
+def empty?
+  @empty
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+65
+66
+67
+
+
# File 'lib/graphql/execution/interpreter/arguments.rb', line 65
+
+def inspect
+  "#<#{self.class} @keyword_arguments=#{keyword_arguments.inspect}>"
+end
+
+
+ +
+

+ + #merge_extras(extra_args) ⇒ Interpreter::Arguments + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Create a new arguments instance which includes these extras.

+ +

This is called by the runtime to implement field extras: [...]

+ + +
+
+
+

Parameters:

+
    + +
  • + + extra_args + + + (Hash<Symbol => Object>) + + + +
  • + +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+76
+77
+78
+79
+80
+81
+
+
# File 'lib/graphql/execution/interpreter/arguments.rb', line 76
+
+def merge_extras(extra_args)
+  self.class.new(
+    argument_values: argument_values,
+    keyword_arguments: keyword_arguments.merge(extra_args)
+  )
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/ArgumentsCache.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/ArgumentsCache.html new file mode 100644 index 0000000000..612e3c8824 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/ArgumentsCache.html @@ -0,0 +1,414 @@ + + + + + + + Class: GraphQL::Execution::Interpreter::ArgumentsCache + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Interpreter::ArgumentsCache + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter/arguments_cache.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(query) ⇒ ArgumentsCache + + + + + +

+
+

Returns a new instance of ArgumentsCache.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
+
# File 'lib/graphql/execution/interpreter/arguments_cache.rb', line 7
+
+def initialize(query)
+  @query = query
+  @dataloader = query.context.dataloader
+  @storage = Hash.new do |h, argument_owner|
+    args_by_parent = if argument_owner.arguments_statically_coercible?
+      shared_values_cache = {}
+      Hash.new do |h2, ignored_parent_object|
+        h2[ignored_parent_object] = shared_values_cache
+      end
+    else
+      Hash.new do |h2, parent_object|
+        args_by_node = {}
+        args_by_node.compare_by_identity
+        h2[parent_object] = args_by_node
+      end
+    end
+    args_by_parent.compare_by_identity
+    h[argument_owner] = args_by_parent
+  end
+  @storage.compare_by_identity
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #dataload_for(ast_node, argument_owner, parent_object) {|Interpreter::Arguments, Lazy<Interpreter::Arguments>| ... } ⇒ Object + + + + + +

+
+ + + +
+
+
+ +

Yields:

+ + +
+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
+
# File 'lib/graphql/execution/interpreter/arguments_cache.rb', line 42
+
+def dataload_for(ast_node, argument_owner, parent_object, &block)
+  # First, normalize all AST or Ruby values to a plain Ruby hash
+  arg_storage = @storage[argument_owner][parent_object]
+  if (args = arg_storage[ast_node])
+    yield(args)
+  else
+    args_hash = self.class.prepare_args_hash(@query, ast_node)
+    argument_owner.coerce_arguments(parent_object, args_hash, @query.context) do |resolved_args|
+      arg_storage[ast_node] = resolved_args
+      yield(resolved_args)
+    end
+  end
+  nil
+end
+
+
+ +
+

+ + #fetch(ast_node, argument_owner, parent_object) ⇒ Object + + + + + +

+ + + + +
+
+
+
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
+
# File 'lib/graphql/execution/interpreter/arguments_cache.rb', line 29
+
+def fetch(ast_node, argument_owner, parent_object)
+  # This runs eagerly if no block is given
+  @storage[argument_owner][parent_object][ast_node] ||= begin
+    args_hash = self.class.prepare_args_hash(@query, ast_node)
+    kwarg_arguments = argument_owner.coerce_arguments(parent_object, args_hash, @query.context)
+    @query.after_lazy(kwarg_arguments) do |resolved_args|
+      @storage[argument_owner][parent_object][ast_node] = resolved_args
+    end
+  end
+
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/ExecutionErrors.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/ExecutionErrors.html new file mode 100644 index 0000000000..c81650b8dc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/ExecutionErrors.html @@ -0,0 +1,284 @@ + + + + + + + Class: GraphQL::Execution::Interpreter::ExecutionErrors + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Interpreter::ExecutionErrors + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter/execution_errors.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(ctx, ast_node, path) ⇒ ExecutionErrors + + + + + +

+
+

Returns a new instance of ExecutionErrors.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+
+
# File 'lib/graphql/execution/interpreter/execution_errors.rb', line 7
+
+def initialize(ctx, ast_node, path)
+  @context = ctx
+  @ast_node = ast_node
+  @path = path
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #add(err_or_msg) ⇒ Object + + + + + +

+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/execution/interpreter/execution_errors.rb', line 13
+
+def add(err_or_msg)
+  err = case err_or_msg
+  when String
+    GraphQL::ExecutionError.new(err_or_msg)
+  when GraphQL::ExecutionError
+    err_or_msg
+  else
+    raise ArgumentError, "expected String or GraphQL::ExecutionError, not #{err_or_msg.class} (#{err_or_msg.inspect})"
+  end
+  err.ast_node ||= @ast_node
+  err.path ||= @path
+  @context.add_error(err)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/ListResultFailedError.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/ListResultFailedError.html new file mode 100644 index 0000000000..2d4bd55924 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/ListResultFailedError.html @@ -0,0 +1,226 @@ + + + + + + + Exception: GraphQL::Execution::Interpreter::ListResultFailedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Execution::Interpreter::ListResultFailedError + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(value:, path:, field:) ⇒ ListResultFailedError + + + + + +

+
+

Returns a new instance of ListResultFailedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+
+
# File 'lib/graphql/execution/interpreter.rb', line 211
+
+def initialize(value:, path:, field:)
+  message = "Failed to build a GraphQL list result for field `#{field.path}` at path `#{path.join(".")}`.\n".dup
+
+  message << "Expected `#{value.inspect}` (#{value.class}) to implement `.each` to satisfy the GraphQL return type `#{field.type.to_type_signature}`.\n"
+
+  if field.connection?
+    message << "\nThis field was treated as a Relay-style connection; add `connection: false` to the `field(...)` to disable this behavior."
+  end
+  super(message)
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/RawValue.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/RawValue.html new file mode 100644 index 0000000000..cee69ecca6 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/RawValue.html @@ -0,0 +1,270 @@ + + + + + + + Class: GraphQL::Execution::Interpreter::RawValue + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Interpreter::RawValue + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter/handles_raw_value.rb
+
+ +
+ +

Overview

+
+

Wrapper for raw values

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(obj = nil) ⇒ RawValue + + + + + +

+
+

Returns a new instance of RawValue.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/execution/interpreter/handles_raw_value.rb', line 8
+
+def initialize(obj = nil)
+  @object = obj
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #resolveObject + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/execution/interpreter/handles_raw_value.rb', line 12
+
+def resolve
+  @object
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/Resolve.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Resolve.html new file mode 100644 index 0000000000..1e8bdad1fd --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Resolve.html @@ -0,0 +1,431 @@ + + + + + + + Module: GraphQL::Execution::Interpreter::Resolve + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Execution::Interpreter::Resolve + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter/resolve.rb
+
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .resolve(results, dataloader) ⇒ void + + + + + +

+
+

This method returns an undefined value.

After getting results back from an interpreter evaluation, +continue it until you get a response-ready Ruby value.

+ +

results is one level of depth of a query or multiplex.

+ +

Resolve all lazy values in that depth before moving on +to the next level.

+ +

It’s assumed that the lazies will +return Lazy instances if there’s more work to be done, +or return Hash/Array if the query should be continued.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+
+
# File 'lib/graphql/execution/interpreter/resolve.rb', line 46
+
+def self.resolve(results, dataloader)
+  # There might be pending jobs here that _will_ write lazies
+  # into the result hash. We should run them out, so we
+  # can be sure that all lazies will be present in the result hashes.
+  # A better implementation would somehow interleave (or unify)
+  # these approaches.
+  dataloader.run
+  next_results = []
+  while results.any?
+    result_value = results.shift
+    if result_value.is_a?(Runtime::GraphQLResultHash) || result_value.is_a?(Hash)
+      results.concat(result_value.values)
+      next
+    elsif result_value.is_a?(Runtime::GraphQLResultArray)
+      results.concat(result_value.values)
+      next
+    elsif result_value.is_a?(Array)
+      results.concat(result_value)
+      next
+    elsif result_value.is_a?(Lazy)
+      loaded_value = result_value.value
+      if loaded_value.is_a?(Lazy)
+        # Since this field returned another lazy,
+        # add it to the same queue
+        results << loaded_value
+      elsif loaded_value.is_a?(Runtime::GraphQLResultHash) || loaded_value.is_a?(Runtime::GraphQLResultArray) ||
+          loaded_value.is_a?(Hash) || loaded_value.is_a?(Array)
+        # Add these values in wholesale --
+        # they might be modified by later work in the dataloader.
+        next_results << loaded_value
+      end
+    end
+  end
+
+  if next_results.any?
+    # Any pending data loader jobs may populate the
+    # resutl arrays or result hashes accumulated in
+    # `next_results``. Run those **to completion**
+    # before continuing to resolve `next_results`.
+    # (Just `.append_job` doesn't work if any pending
+    # jobs require multiple passes.)
+    dataloader.run
+    dataloader.append_job { resolve(next_results, dataloader) }
+  end
+
+  nil
+end
+
+
+ +
+

+ + .resolve_all(results, dataloader) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Continue field results in results until there’s nothing else to continue.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+12
+
+
# File 'lib/graphql/execution/interpreter/resolve.rb', line 9
+
+def self.resolve_all(results, dataloader)
+  dataloader.append_job { resolve(results, dataloader) }
+  nil
+end
+
+
+ +
+

+ + .resolve_each_depth(lazies_at_depth, dataloader) ⇒ Object + + + + + +

+ + + + +
+
+
+
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
+
# File 'lib/graphql/execution/interpreter/resolve.rb', line 14
+
+def self.resolve_each_depth(lazies_at_depth, dataloader)
+  depths = lazies_at_depth.keys
+  depths.sort!
+  next_depth = depths.first
+  if next_depth
+    lazies = lazies_at_depth[next_depth]
+    lazies_at_depth.delete(next_depth)
+    if lazies.any?
+      dataloader.append_job {
+        lazies.each(&:value) # resolve these Lazy instances
+      }
+      # Run lazies _and_ dataloader, see if more are enqueued
+      dataloader.run
+      resolve_each_depth(lazies_at_depth, dataloader)
+    end
+  end
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime.html new file mode 100644 index 0000000000..a995698b4d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime.html @@ -0,0 +1,3868 @@ + + + + + + + Class: GraphQL::Execution::Interpreter::Runtime + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Interpreter::Runtime + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter/runtime.rb,
+ lib/graphql/execution/interpreter/runtime/graphql_result.rb
+
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

I think it would be even better if we could somehow make +continue_field not recursive. “Trampolining” it somehow.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: GraphQLResult + + + + Classes: CurrentState, GraphQLResultArray, GraphQLResultHash + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
NO_ARGS = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
GraphQL::EmptyObjects::EMPTY_HASH
+ +
HALT = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
Object.new
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(query:, lazies_at_depth:) ⇒ Runtime + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of Runtime.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 35
+
+def initialize(query:, lazies_at_depth:)
+  @query = query
+  @current_trace = query.current_trace
+  @dataloader = query.multiplex.dataloader
+  @lazies_at_depth = lazies_at_depth
+  @schema = query.schema
+  @context = query.context
+  @response = GraphQLResultHash.new(nil, nil, false)
+  # Identify runtime directives by checking which of this schema's directives have overridden `def self.resolve`
+  @runtime_directive_names = []
+  noop_resolve_owner = GraphQL::Schema::Directive.singleton_class
+  @schema_directives = schema.directives
+  @schema_directives.each do |name, dir_defn|
+    if dir_defn.method(:resolve).owner != noop_resolve_owner
+      @runtime_directive_names << name
+    end
+  end
+  # { Class => Boolean }
+  @lazy_cache = {}
+  @lazy_cache.compare_by_identity
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #contextGraphQL::Query::Context (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 33
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #queryGraphQL::Query (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 27
+
+def query
+  @query
+end
+
+
+ + + +
+

+ + #schemaClass<GraphQL::Schema> (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 30
+
+def schema
+  @schema
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #after_lazy(lazy_obj, field:, owner_object:, arguments:, ast_node:, result:, result_name:, eager: false, runtime_state:, trace: true, &block) ⇒ GraphQL::Execution::Lazy, Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns If loading object will be deferred, it’s a wrapper over it.

+ + +
+
+
+

Parameters:

+
    + +
  • + + obj + + + (Object) + + + + — +

    Some user-returned value that may want to be batched

    +
    + +
  • + +
  • + + field + + + (GraphQL::Schema::Field) + + + +
  • + +
  • + + eager + + + (Boolean) + + + (defaults to: false) + + + — +

    Set to true for mutation root fields only

    +
    + +
  • + +
  • + + trace + + + (Boolean) + + + (defaults to: true) + + + — +

    If false, don’t wrap this with field tracing

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (GraphQL::Execution::Lazy, Object) + + + + — +

    If loading object will be deferred, it’s a wrapper over it.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 779
+
+def after_lazy(lazy_obj, field:, owner_object:, arguments:, ast_node:, result:, result_name:, eager: false, runtime_state:, trace: true, &block)
+  if lazy?(lazy_obj)
+    orig_result = result
+    was_authorized_by_scope_items = runtime_state.was_authorized_by_scope_items
+    lazy = GraphQL::Execution::Lazy.new(field: field) do
+      # This block might be called in a new fiber;
+      # In that case, this will initialize a new state
+      # to avoid conflicting with the parent fiber.
+      runtime_state = get_current_runtime_state
+      runtime_state.current_object = owner_object
+      runtime_state.current_field = field
+      runtime_state.current_arguments = arguments
+      runtime_state.current_result_name = result_name
+      runtime_state.current_result = orig_result
+      runtime_state.was_authorized_by_scope_items = was_authorized_by_scope_items
+      # Wrap the execution of _this_ method with tracing,
+      # but don't wrap the continuation below
+      inner_obj = begin
+        if trace
+          @current_trace.execute_field_lazy(field: field, query: query, object: owner_object, arguments: arguments, ast_node: ast_node) do
+            schema.sync_lazy(lazy_obj)
+          end
+        else
+          schema.sync_lazy(lazy_obj)
+        end
+      rescue GraphQL::ExecutionError, GraphQL::UnauthorizedError => ex_err
+        ex_err
+      rescue StandardError => err
+        begin
+          query.handle_or_reraise(err)
+        rescue GraphQL::ExecutionError => ex_err
+          ex_err
+        end
+      end
+      yield(inner_obj, runtime_state)
+    end
+
+    if eager
+      lazy.value
+    else
+      set_result(result, result_name, lazy, false, false) # is_non_null is irrelevant here
+      current_depth = 0
+      while result
+        current_depth += 1
+        result = result.graphql_parent
+      end
+      @lazies_at_depth[current_depth] << lazy
+      lazy
+    end
+  else
+    # Don't need to reset state here because it _wasn't_ lazy.
+    yield(lazy_obj, runtime_state)
+  end
+end
+
+
+ +
+

+ + #arguments(graphql_object, arg_owner, ast_node) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+834
+835
+836
+837
+838
+839
+840
+841
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 834
+
+def arguments(graphql_object, arg_owner, ast_node)
+  if arg_owner.arguments_statically_coercible?
+    query.arguments_for(ast_node, arg_owner)
+  else
+    # The arguments must be prepared in the context of the given object
+    query.arguments_for(ast_node, arg_owner, parent_object: graphql_object)
+  end
+end
+
+
+ +
+

+ + #call_method_on_directives(method_name, object, directives, &block) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+708
+709
+710
+711
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 708
+
+def call_method_on_directives(method_name, object, directives, &block)
+  return yield if directives.nil? || directives.empty?
+  run_directive(method_name, object, directives, 0, &block)
+end
+
+
+ +
+

+ + #continue_field(value, owner_type, field, current_type, ast_node, next_selections, is_non_null, owner_object, arguments, result_name, selection_result, was_scoped, runtime_state) ⇒ Lazy, ... + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

The resolver for field returned value. Continue to execute the query, +treating value as type (probably the return type of the field).

+ +

Use next_selections to resolve object fields, if there are any.

+ +

Location information from path and ast_node.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Lazy, Array, Hash, Object) + + + + — +

    Lazy, Array, and Hash are all traversed to resolve lazy values later

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 554
+
+def continue_field(value, owner_type, field, current_type, ast_node, next_selections, is_non_null, owner_object, arguments, result_name, selection_result, was_scoped, runtime_state) # rubocop:disable Metrics/ParameterLists
+  if current_type.non_null?
+    current_type = current_type.of_type
+    is_non_null = true
+  end
+
+  case current_type.kind.name
+  when "SCALAR", "ENUM"
+    r = begin
+      current_type.coerce_result(value, context)
+    rescue StandardError => err
+      schema.handle_or_reraise(context, err)
+    end
+    set_result(selection_result, result_name, r, false, is_non_null)
+    r
+  when "UNION", "INTERFACE"
+    resolved_type_or_lazy = resolve_type(current_type, value)
+    after_lazy(resolved_type_or_lazy, ast_node: ast_node, field: field, owner_object: owner_object, arguments: arguments, trace: false, result_name: result_name, result: selection_result, runtime_state: runtime_state) do |resolved_type_result, runtime_state|
+      if resolved_type_result.is_a?(Array) && resolved_type_result.length == 2
+        resolved_type, resolved_value = resolved_type_result
+      else
+        resolved_type = resolved_type_result
+        resolved_value = value
+      end
+
+      possible_types = query.possible_types(current_type)
+      if !possible_types.include?(resolved_type)
+        parent_type = field.owner_type
+        err_class = current_type::UnresolvedTypeError
+        type_error = err_class.new(resolved_value, field, parent_type, resolved_type, possible_types)
+        schema.type_error(type_error, context)
+        set_result(selection_result, result_name, nil, false, is_non_null)
+        nil
+      else
+        continue_field(resolved_value, owner_type, field, resolved_type, ast_node, next_selections, is_non_null, owner_object, arguments, result_name, selection_result, was_scoped, runtime_state)
+      end
+    end
+  when "OBJECT"
+    object_proxy = begin
+      was_scoped ? current_type.wrap_scoped(value, context) : current_type.wrap(value, context)
+    rescue GraphQL::ExecutionError => err
+      err
+    end
+    after_lazy(object_proxy, ast_node: ast_node, field: field, owner_object: owner_object, arguments: arguments, trace: false, result_name: result_name, result: selection_result, runtime_state: runtime_state) do |inner_object, runtime_state|
+      continue_value = continue_value(inner_object, owner_type, field, is_non_null, ast_node, result_name, selection_result)
+      if HALT != continue_value
+        response_hash = GraphQLResultHash.new(result_name, selection_result, is_non_null)
+        set_result(selection_result, result_name, response_hash, true, is_non_null)
+
+        gathered_selections = gather_selections(continue_value, current_type, next_selections)
+        # There are two possibilities for `gathered_selections`:
+        # 1. All selections of this object should be evaluated together (there are no runtime directives modifying execution).
+        #    This case is handled below, and the result can be written right into the main `response_hash` above.
+        #    In this case, `gathered_selections` is a hash of selections.
+        # 2. Some selections of this object have runtime directives that may or may not modify execution.
+        #    That part of the selection is evaluated in an isolated way, writing into a sub-response object which is
+        #    eventually merged into the final response. In this case, `gathered_selections` is an array of things to run in isolation.
+        #    (Technically, it's possible that one of those entries _doesn't_ require isolation.)
+        tap_or_each(gathered_selections) do |selections, is_selection_array|
+          if is_selection_array
+            this_result = GraphQLResultHash.new(result_name, selection_result, is_non_null)
+            final_result = response_hash
+          else
+            this_result = response_hash
+            final_result = nil
+          end
+          # reset this mutable state
+          # Unset `result_name` here because it's already included in the new response hash
+          runtime_state.current_object = continue_value
+          runtime_state.current_result_name = nil
+          runtime_state.current_result = this_result
+          # This is a less-frequent case; use a fast check since it's often not there.
+          if (directives = selections[:graphql_directives])
+            selections.delete(:graphql_directives)
+          end
+          call_method_on_directives(:resolve, continue_value, directives) do
+            evaluate_selections(
+              continue_value,
+              current_type,
+              false,
+              selections,
+              this_result,
+              final_result,
+              owner_object.object,
+              runtime_state,
+            )
+            this_result
+          end
+        end
+      end
+    end
+  when "LIST"
+    inner_type = current_type.of_type
+    # This is true for objects, unions, and interfaces
+    use_dataloader_job = !inner_type.unwrap.kind.input?
+    inner_type_non_null = inner_type.non_null?
+    response_list = GraphQLResultArray.new(result_name, selection_result, is_non_null)
+    set_result(selection_result, result_name, response_list, true, is_non_null)
+    idx = nil
+    list_value = begin
+      value.each do |inner_value|
+        idx ||= 0
+        this_idx = idx
+        idx += 1
+        if use_dataloader_job
+          @dataloader.append_job do
+            resolve_list_item(inner_value, inner_type, inner_type_non_null, ast_node, field, owner_object, arguments, this_idx, response_list, next_selections, owner_type, was_scoped, runtime_state)
+          end
+        else
+          resolve_list_item(inner_value, inner_type, inner_type_non_null, ast_node, field, owner_object, arguments, this_idx, response_list, next_selections, owner_type, was_scoped, runtime_state)
+        end
+      end
+
+      response_list
+    rescue NoMethodError => err
+      # Ruby 2.2 doesn't have NoMethodError#receiver, can't check that one in this case. (It's been EOL since 2017.)
+      if err.name == :each && (err.respond_to?(:receiver) ? err.receiver == value : true)
+        # This happens when the GraphQL schema doesn't match the implementation. Help the dev debug.
+        raise ListResultFailedError.new(value: value, field: field, path: current_path)
+      else
+        # This was some other NoMethodError -- let it bubble to reveal the real error.
+        raise
+      end
+    rescue GraphQL::ExecutionError, GraphQL::UnauthorizedError => ex_err
+      ex_err
+    rescue StandardError => err
+      begin
+        query.handle_or_reraise(err)
+      rescue GraphQL::ExecutionError => ex_err
+        ex_err
+      end
+    end
+    # Detect whether this error came while calling `.each` (before `idx` is set) or while running list *items* (after `idx` is set)
+    error_is_non_null = idx.nil? ? is_non_null : inner_type.non_null?
+    continue_value(list_value, owner_type, field, error_is_non_null, ast_node, result_name, selection_result)
+  else
+    raise "Invariant: Unhandled type kind #{current_type.kind} (#{current_type})"
+  end
+end
+
+
+ +
+

+ + #continue_value(value, parent_type, field, is_non_null, ast_node, result_name, selection_result) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

rubocop:disable Metrics/ParameterLists

+ + +
+
+
+ + +
+ + + + +
+
+
+
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 450
+
+def continue_value(value, parent_type, field, is_non_null, ast_node, result_name, selection_result) # rubocop:disable Metrics/ParameterLists
+  case value
+  when nil
+    if is_non_null
+      set_result(selection_result, result_name, nil, false, is_non_null) do
+        # This block is called if `result_name` is not dead. (Maybe a previous invalid nil caused it be marked dead.)
+        err = parent_type::InvalidNullError.new(parent_type, field, value)
+        schema.type_error(err, context)
+      end
+    else
+      set_result(selection_result, result_name, nil, false, is_non_null)
+    end
+    HALT
+  when GraphQL::Error
+    # Handle these cases inside a single `when`
+    # to avoid the overhead of checking three different classes
+    # every time.
+    if value.is_a?(GraphQL::ExecutionError)
+      if selection_result.nil? || !dead_result?(selection_result)
+        value.path ||= current_path
+        value.ast_node ||= ast_node
+        context.errors << value
+        if selection_result
+          set_result(selection_result, result_name, nil, false, is_non_null)
+        end
+      end
+      HALT
+    elsif value.is_a?(GraphQL::UnauthorizedFieldError)
+      value.field ||= field
+      # this hook might raise & crash, or it might return
+      # a replacement value
+      next_value = begin
+        schema.unauthorized_field(value)
+      rescue GraphQL::ExecutionError => err
+        err
+      end
+      continue_value(next_value, parent_type, field, is_non_null, ast_node, result_name, selection_result)
+    elsif value.is_a?(GraphQL::UnauthorizedError)
+      # this hook might raise & crash, or it might return
+      # a replacement value
+      next_value = begin
+        schema.unauthorized_object(value)
+      rescue GraphQL::ExecutionError => err
+        err
+      end
+      continue_value(next_value, parent_type, field, is_non_null, ast_node, result_name, selection_result)
+    elsif GraphQL::Execution::SKIP == value
+      # It's possible a lazy was already written here
+      case selection_result
+      when GraphQLResultHash
+        selection_result.delete(result_name)
+      when GraphQLResultArray
+        selection_result.graphql_skip_at(result_name)
+      when nil
+        # this can happen with directives
+      else
+        raise "Invariant: unexpected result class #{selection_result.class} (#{selection_result.inspect})"
+      end
+      HALT
+    else
+      # What could this actually _be_? Anyhow,
+      # preserve the default behavior of doing nothing with it.
+      value
+    end
+  when Array
+    # It's an array full of execution errors; add them all.
+    if value.any? && value.all? { |v| v.is_a?(GraphQL::ExecutionError) }
+      list_type_at_all = (field && (field.type.list?))
+      if selection_result.nil? || !dead_result?(selection_result)
+        value.each_with_index do |error, index|
+          error.ast_node ||= ast_node
+          error.path ||= current_path + (list_type_at_all ? [index] : [])
+          context.errors << error
+        end
+        if selection_result
+          if list_type_at_all
+            result_without_errors = value.map { |v| v.is_a?(GraphQL::ExecutionError) ? nil : v }
+            set_result(selection_result, result_name, result_without_errors, false, is_non_null)
+          else
+            set_result(selection_result, result_name, nil, false, is_non_null)
+          end
+        end
+      end
+      HALT
+    else
+      value
+    end
+  when GraphQL::Execution::Interpreter::RawValue
+    # Write raw value directly to the response without resolving nested objects
+    set_result(selection_result, result_name, value.resolve, false, is_non_null)
+    HALT
+  else
+    value
+  end
+end
+
+
+ +
+

+ + #current_pathObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 438
+
+def current_path
+  st = get_current_runtime_state
+  result = st.current_result
+  path = result && result.path
+  if path && (rn = st.current_result_name)
+    path = path.dup
+    path.push(rn)
+  end
+  path
+end
+
+
+ +
+

+ + #dead_result?(selection_result) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+391
+392
+393
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 391
+
+def dead_result?(selection_result)
+  selection_result.graphql_dead  # || ((parent = selection_result.graphql_parent) && parent.graphql_dead)
+end
+
+
+ +
+

+ + #delete_all_interpreter_contextObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 843
+
+def delete_all_interpreter_context
+  per_query_state = Thread.current[:__graphql_runtime_info]
+  if per_query_state
+    per_query_state.delete(@query)
+    if per_query_state.size == 0
+      Thread.current[:__graphql_runtime_info] = nil
+    end
+  end
+  nil
+end
+
+
+ +
+

+ + #directives_include?(node, graphql_object, parent_type) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Check Schema::Directive.include? for each directive that’s present

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 741
+
+def directives_include?(node, graphql_object, parent_type)
+  node.directives.each do |dir_node|
+    dir_defn = @schema_directives.fetch(dir_node.name)
+    args = arguments(graphql_object, dir_defn, dir_node)
+    if !dir_defn.include?(graphql_object, args, context)
+      return false
+    end
+  end
+  true
+end
+
+
+ +
+

+ + #evaluate_selection(result_name, field_ast_nodes_or_ast_node, owner_object, owner_type, is_eager_field, selections_result, parent_object, runtime_state) ⇒ void + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This method returns an undefined value.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 236
+
+def evaluate_selection(result_name, field_ast_nodes_or_ast_node, owner_object, owner_type, is_eager_field, selections_result, parent_object, runtime_state) # rubocop:disable Metrics/ParameterLists
+  return if dead_result?(selections_result)
+  # As a performance optimization, the hash key will be a `Node` if
+  # there's only one selection of the field. But if there are multiple
+  # selections of the field, it will be an Array of nodes
+  if field_ast_nodes_or_ast_node.is_a?(Array)
+    field_ast_nodes = field_ast_nodes_or_ast_node
+    ast_node = field_ast_nodes.first
+  else
+    field_ast_nodes = nil
+    ast_node = field_ast_nodes_or_ast_node
+  end
+  field_name = ast_node.name
+  field_defn = query.warden.get_field(owner_type, field_name)
+
+  # Set this before calling `run_with_directives`, so that the directive can have the latest path
+  runtime_state.current_field = field_defn
+  runtime_state.current_result = selections_result
+  runtime_state.current_result_name = result_name
+
+  if field_defn.dynamic_introspection
+    owner_object = field_defn.owner.wrap(owner_object, context)
+  end
+
+  return_type = field_defn.type
+  if !field_defn.any_arguments?
+    resolved_arguments = GraphQL::Execution::Interpreter::Arguments::EMPTY
+    if field_defn.extras.size == 0
+      evaluate_selection_with_resolved_keyword_args(
+        NO_ARGS, resolved_arguments, field_defn, ast_node, field_ast_nodes, owner_type, owner_object, is_eager_field, result_name, selections_result, parent_object, return_type, return_type.non_null?, runtime_state
+      )
+    else
+      evaluate_selection_with_args(resolved_arguments, field_defn, ast_node, field_ast_nodes, owner_type, owner_object, is_eager_field, result_name, selections_result, parent_object, return_type, runtime_state)
+    end
+  else
+    @query.arguments_cache.dataload_for(ast_node, field_defn, owner_object) do |resolved_arguments|
+      runtime_state = get_current_runtime_state # This might be in a different fiber
+      evaluate_selection_with_args(resolved_arguments, field_defn, ast_node, field_ast_nodes, owner_type, owner_object, is_eager_field, result_name, selections_result, parent_object, return_type, runtime_state)
+    end
+  end
+end
+
+
+ +
+

+ + #evaluate_selection_with_args(arguments, field_defn, ast_node, field_ast_nodes, owner_type, object, is_eager_field, result_name, selection_result, parent_object, return_type, runtime_state) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

rubocop:disable Metrics/ParameterLists

+ + +
+
+
+ + +
+ + + + +
+
+
+
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 278
+
+def evaluate_selection_with_args(arguments, field_defn, ast_node, field_ast_nodes, owner_type, object, is_eager_field, result_name, selection_result, parent_object, return_type, runtime_state)  # rubocop:disable Metrics/ParameterLists
+  after_lazy(arguments, field: field_defn, ast_node: ast_node, owner_object: object, arguments: arguments, result_name: result_name, result: selection_result, runtime_state: runtime_state) do |resolved_arguments, runtime_state|
+    return_type_non_null = return_type.non_null?
+    if resolved_arguments.is_a?(GraphQL::ExecutionError) || resolved_arguments.is_a?(GraphQL::UnauthorizedError)
+      continue_value(resolved_arguments, owner_type, field_defn, return_type_non_null, ast_node, result_name, selection_result)
+      next
+    end
+
+    kwarg_arguments = if field_defn.extras.empty?
+      if resolved_arguments.empty?
+        # We can avoid allocating the `{ Symbol => Object }` hash in this case
+        NO_ARGS
+      else
+        resolved_arguments.keyword_arguments
+      end
+    else
+      # Bundle up the extras, then make a new arguments instance
+      # that includes the extras, too.
+      extra_args = {}
+      field_defn.extras.each do |extra|
+        case extra
+        when :ast_node
+          extra_args[:ast_node] = ast_node
+        when :execution_errors
+          extra_args[:execution_errors] = ExecutionErrors.new(context, ast_node, current_path)
+        when :path
+          extra_args[:path] = current_path
+        when :lookahead
+          if !field_ast_nodes
+            field_ast_nodes = [ast_node]
+          end
+
+          extra_args[:lookahead] = Execution::Lookahead.new(
+            query: query,
+            ast_nodes: field_ast_nodes,
+            field: field_defn,
+          )
+        when :argument_details
+          # Use this flag to tell Interpreter::Arguments to add itself
+          # to the keyword args hash _before_ freezing everything.
+          extra_args[:argument_details] = :__arguments_add_self
+        when :parent
+          extra_args[:parent] = parent_object
+        else
+          extra_args[extra] = field_defn.fetch_extra(extra, context)
+        end
+      end
+      if extra_args.any?
+        resolved_arguments = resolved_arguments.merge_extras(extra_args)
+      end
+      resolved_arguments.keyword_arguments
+    end
+
+    evaluate_selection_with_resolved_keyword_args(kwarg_arguments, resolved_arguments, field_defn, ast_node, field_ast_nodes, owner_type, object, is_eager_field, result_name, selection_result, parent_object, return_type, return_type_non_null, runtime_state)
+  end
+end
+
+
+ +
+

+ + #evaluate_selection_with_resolved_keyword_args(kwarg_arguments, resolved_arguments, field_defn, ast_node, field_ast_nodes, owner_type, object, is_eager_field, result_name, selection_result, parent_object, return_type, return_type_non_null, runtime_state) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

rubocop:disable Metrics/ParameterLists

+ + +
+
+
+ + +
+ + + + +
+
+
+
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 335
+
+def evaluate_selection_with_resolved_keyword_args(kwarg_arguments, resolved_arguments, field_defn, ast_node, field_ast_nodes, owner_type, object, is_eager_field, result_name, selection_result, parent_object, return_type, return_type_non_null, runtime_state)  # rubocop:disable Metrics/ParameterLists
+  runtime_state.current_field = field_defn
+  runtime_state.current_object = object
+  runtime_state.current_arguments = resolved_arguments
+  runtime_state.current_result_name = result_name
+  runtime_state.current_result = selection_result
+  # Optimize for the case that field is selected only once
+  if field_ast_nodes.nil? || field_ast_nodes.size == 1
+    next_selections = ast_node.selections
+    directives = ast_node.directives
+  else
+    next_selections = []
+    directives = []
+    field_ast_nodes.each { |f|
+      next_selections.concat(f.selections)
+      directives.concat(f.directives)
+    }
+  end
+
+  field_result = call_method_on_directives(:resolve, object, directives) do
+    # Actually call the field resolver and capture the result
+    app_result = begin
+      @current_trace.execute_field(field: field_defn, ast_node: ast_node, query: query, object: object, arguments: kwarg_arguments) do
+        field_defn.resolve(object, kwarg_arguments, context)
+      end
+    rescue GraphQL::ExecutionError => err
+      err
+    rescue StandardError => err
+      begin
+        query.handle_or_reraise(err)
+      rescue GraphQL::ExecutionError => ex_err
+        ex_err
+      end
+    end
+    after_lazy(app_result, field: field_defn, ast_node: ast_node, owner_object: object, arguments: resolved_arguments, result_name: result_name, result: selection_result, runtime_state: runtime_state) do |inner_result, runtime_state|
+      continue_value = continue_value(inner_result, owner_type, field_defn, return_type_non_null, ast_node, result_name, selection_result)
+      if HALT != continue_value
+        was_scoped = runtime_state.was_authorized_by_scope_items
+        runtime_state.was_authorized_by_scope_items = nil
+        continue_field(continue_value, owner_type, field_defn, return_type, ast_node, next_selections, false, object, resolved_arguments, result_name, selection_result, was_scoped, runtime_state)
+      end
+    end
+  end
+
+  # If this field is a root mutation field, immediately resolve
+  # all of its child fields before moving on to the next root mutation field.
+  # (Subselections of this mutation will still be resolved level-by-level.)
+  if is_eager_field
+    Interpreter::Resolve.resolve_all([field_result], @dataloader)
+  else
+    # Return this from `after_lazy` because it might be another lazy that needs to be resolved
+    field_result
+  end
+end
+
+
+ +
+

+ + #evaluate_selections(owner_object, owner_type, is_eager_selection, gathered_selections, selections_result, target_result, parent_object, runtime_state) ⇒ void + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This method returns an undefined value.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 208
+
+def evaluate_selections(owner_object, owner_type, is_eager_selection, gathered_selections, selections_result, target_result, parent_object, runtime_state) # rubocop:disable Metrics/ParameterLists
+  finished_jobs = 0
+  enqueued_jobs = gathered_selections.size
+  gathered_selections.each do |result_name, field_ast_nodes_or_ast_node|
+    @dataloader.append_job {
+      runtime_state = get_current_runtime_state
+      evaluate_selection(
+        result_name, field_ast_nodes_or_ast_node, owner_object, owner_type, is_eager_selection, selections_result, parent_object, runtime_state
+      )
+      finished_jobs += 1
+      if target_result && finished_jobs == enqueued_jobs
+        selections_result.merge_into(target_result)
+      end
+    }
+    # Field resolution may pause the fiber,
+    # so it wouldn't get to the `Resolve` call that happens below.
+    # So instead trigger a run from this outer context.
+    if is_eager_selection
+      @dataloader.clear_cache
+      @dataloader.run
+      @dataloader.clear_cache
+    end
+  end
+
+  selections_result
+end
+
+
+ +
+

+ + #final_resultObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 57
+
+def final_result
+  @response && @response.graphql_result_data
+end
+
+
+ +
+

+ + #gather_selections(owner_object, owner_type, selections, selections_to_run = nil, selections_by_name = {}) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 139
+
+def gather_selections(owner_object, owner_type, selections, selections_to_run = nil, selections_by_name = {})
+
+  selections.each do |node|
+    # Skip gathering this if the directive says so
+    if !directives_include?(node, owner_object, owner_type)
+      next
+    end
+
+    if node.is_a?(GraphQL::Language::Nodes::Field)
+      response_key = node.alias || node.name
+      selections = selections_by_name[response_key]
+      # if there was already a selection of this field,
+      # use an array to hold all selections,
+      # otherise, use the single node to represent the selection
+      if selections
+        # This field was already selected at least once,
+        # add this node to the list of selections
+        s = Array(selections)
+        s << node
+        selections_by_name[response_key] = s
+      else
+        # No selection was found for this field yet
+        selections_by_name[response_key] = node
+      end
+    else
+      # This is an InlineFragment or a FragmentSpread
+      if @runtime_directive_names.any? && node.directives.any? { |d| @runtime_directive_names.include?(d.name) }
+        next_selections = {}
+        next_selections[:graphql_directives] = node.directives
+        if selections_to_run
+          selections_to_run << next_selections
+        else
+          selections_to_run = []
+          selections_to_run << selections_by_name
+          selections_to_run << next_selections
+        end
+      else
+        next_selections = selections_by_name
+      end
+
+      case node
+      when GraphQL::Language::Nodes::InlineFragment
+        if node.type
+          type_defn = schema.get_type(node.type.name, context)
+
+          if query.warden.possible_types(type_defn).include?(owner_type)
+            gather_selections(owner_object, owner_type, node.selections, selections_to_run, next_selections)
+          end
+        else
+          # it's an untyped fragment, definitely continue
+          gather_selections(owner_object, owner_type, node.selections, selections_to_run, next_selections)
+        end
+      when GraphQL::Language::Nodes::FragmentSpread
+        fragment_def = query.fragments[node.name]
+        type_defn = query.get_type(fragment_def.type.name)
+        if query.warden.possible_types(type_defn).include?(owner_type)
+          gather_selections(owner_object, owner_type, fragment_def.selections, selections_to_run, next_selections)
+        end
+      else
+        raise "Invariant: unexpected selection class: #{node.class}"
+      end
+    end
+  end
+  selections_to_run || selections_by_name
+end
+
+
+ +
+

+ + #get_current_runtime_stateObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+752
+753
+754
+755
+756
+757
+758
+759
+760
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 752
+
+def get_current_runtime_state
+  current_state = Thread.current[:__graphql_runtime_info] ||= begin
+    per_query_state = {}
+    per_query_state.compare_by_identity
+    per_query_state
+  end
+
+  current_state[@query] ||= CurrentState.new
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+61
+62
+63
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 61
+
+def inspect
+  "#<#{self.class.name} response=#{@response.inspect}>"
+end
+
+
+ +
+

+ + #lazy?(object) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+870
+871
+872
+873
+874
+875
+876
+877
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 870
+
+def lazy?(object)
+  obj_class = object.class
+  is_lazy = @lazy_cache[obj_class]
+  if is_lazy.nil?
+    is_lazy = @lazy_cache[obj_class] = @schema.lazy?(object)
+  end
+  is_lazy
+end
+
+
+ +
+

+ + #minimal_after_lazy(value, &block) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 762
+
+def minimal_after_lazy(value, &block)
+  if lazy?(value)
+    GraphQL::Execution::Lazy.new do
+      result = @schema.sync_lazy(value)
+      # The returned result might also be lazy, so check it, too
+      minimal_after_lazy(result, &block)
+    end
+  else
+    yield(value)
+  end
+end
+
+
+ +
+

+ + #resolve_list_item(inner_value, inner_type, inner_type_non_null, ast_node, field, owner_object, arguments, this_idx, response_list, next_selections, owner_type, was_scoped, runtime_state) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

rubocop:disable Metrics/ParameterLists

+ + +
+
+
+ + +
+ + + + +
+
+
+
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 694
+
+def resolve_list_item(inner_value, inner_type, inner_type_non_null, ast_node, field, owner_object, arguments, this_idx, response_list, next_selections, owner_type, was_scoped, runtime_state) # rubocop:disable Metrics/ParameterLists
+  runtime_state.current_result_name = this_idx
+  runtime_state.current_result = response_list
+  call_method_on_directives(:resolve_each, owner_object, ast_node.directives) do
+    # This will update `response_list` with the lazy
+    after_lazy(inner_value, ast_node: ast_node, field: field, owner_object: owner_object, arguments: arguments, result_name: this_idx, result: response_list, runtime_state: runtime_state) do |inner_inner_value, runtime_state|
+      continue_value = continue_value(inner_inner_value, owner_type, field, inner_type_non_null, ast_node, this_idx, response_list)
+      if HALT != continue_value
+        continue_field(continue_value, owner_type, field, inner_type, ast_node, next_selections, false, owner_object, arguments, this_idx, response_list, was_scoped, runtime_state)
+      end
+    end
+  end
+end
+
+
+ +
+

+ + #resolve_type(type, value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 854
+
+def resolve_type(type, value)
+  resolved_type, resolved_value = @current_trace.resolve_type(query: query, type: type, object: value) do
+    query.resolve_type(type, value)
+  end
+
+  if lazy?(resolved_type)
+    GraphQL::Execution::Lazy.new do
+      @current_trace.resolve_type_lazy(query: query, type: type, object: value) do
+        schema.sync_lazy(resolved_type)
+      end
+    end
+  else
+    [resolved_type, resolved_value]
+  end
+end
+
+
+ +
+

+ + #run_directive(method_name, object, directives, idx, &block) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 713
+
+def run_directive(method_name, object, directives, idx, &block)
+  dir_node = directives[idx]
+  if !dir_node
+    yield
+  else
+    dir_defn = @schema_directives.fetch(dir_node.name)
+    raw_dir_args = arguments(nil, dir_defn, dir_node)
+    dir_args = continue_value(
+      raw_dir_args, # value
+      dir_defn, # parent_type
+      nil, # field
+      false, # is_non_null
+      dir_node, # ast_node
+      nil, # result_name
+      nil, # selection_result
+    )
+
+    if dir_args == HALT
+      nil
+    else
+      dir_defn.public_send(method_name, object, dir_args, context) do
+        run_directive(method_name, object, directives, idx + 1, &block)
+      end
+    end
+  end
+end
+
+
+ +
+

+ + #run_eagervoid + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This method returns an undefined value.

This begins the execution. Some deferred work +might be stored up in lazies.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 78
+
+def run_eager
+  root_operation = query.selected_operation
+  root_op_type = root_operation.operation_type || "query"
+  root_type = schema.root_type_for_operation(root_op_type)
+
+  st = get_current_runtime_state
+  st.current_object = query.root_value
+  st.current_result = @response
+  runtime_object = root_type.wrap(query.root_value, context)
+  runtime_object = schema.sync_lazy(runtime_object)
+
+  if runtime_object.nil?
+    # Root .authorized? returned false.
+    @response = nil
+  else
+    call_method_on_directives(:resolve, runtime_object, root_operation.directives) do # execute query level directives
+      gathered_selections = gather_selections(runtime_object, root_type, root_operation.selections)
+      # This is kind of a hack -- `gathered_selections` is an Array if any of the selections
+      # require isolation during execution (because of runtime directives). In that case,
+      # make a new, isolated result hash for writing the result into. (That isolated response
+      # is eventually merged back into the main response)
+      #
+      # Otherwise, `gathered_selections` is a hash of selections which can be
+      # directly evaluated and the results can be written right into the main response hash.
+      tap_or_each(gathered_selections) do |selections, is_selection_array|
+        if is_selection_array
+          selection_response = GraphQLResultHash.new(nil, nil, false)
+          final_response = @response
+        else
+          selection_response = @response
+          final_response = nil
+        end
+
+        @dataloader.append_job {
+          st = get_current_runtime_state
+          st.current_object = query.root_value
+          st.current_result_name = nil
+          st.current_result = selection_response
+          # This is a less-frequent case; use a fast check since it's often not there.
+          if (directives = selections[:graphql_directives])
+            selections.delete(:graphql_directives)
+          end
+          call_method_on_directives(:resolve, runtime_object, directives) do
+            evaluate_selections(
+              runtime_object,
+              root_type,
+              root_op_type == "mutation",
+              selections,
+              selection_response,
+              final_response,
+              nil,
+              st,
+            )
+          end
+        }
+      end
+    end
+  end
+  nil
+end
+
+
+ +
+

+ + #set_graphql_dead(selection_result) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Mark this node and any already-registered children as dead, +so that it accepts no more writes.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 425
+
+def set_graphql_dead(selection_result)
+  case selection_result
+  when GraphQLResultArray
+    selection_result.graphql_dead = true
+    selection_result.values.each { |v| set_graphql_dead(v) }
+  when GraphQLResultHash
+    selection_result.graphql_dead = true
+    selection_result.each { |k, v| set_graphql_dead(v) }
+  else
+    # It's a scalar, no way to mark it dead.
+  end
+end
+
+
+ +
+

+ + #set_result(selection_result, result_name, value, is_child_result, is_non_null) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 395
+
+def set_result(selection_result, result_name, value, is_child_result, is_non_null)
+  if !dead_result?(selection_result)
+    if value.nil? && is_non_null
+      # This is an invalid nil that should be propagated
+      # One caller of this method passes a block,
+      # namely when application code returns a `nil` to GraphQL and it doesn't belong there.
+      # The other possibility for reaching here is when a field returns an ExecutionError, so we write
+      # `nil` to the response, not knowing whether it's an invalid `nil` or not.
+      # (And in that case, we don't have to call the schema's handler, since it's not a bug in the application.)
+      # TODO the code is trying to tell me something.
+      yield if block_given?
+      parent = selection_result.graphql_parent
+      if parent.nil? # This is a top-level result hash
+        @response = nil
+      else
+        name_in_parent = selection_result.graphql_result_name
+        is_non_null_in_parent = selection_result.graphql_is_non_null_in_parent
+        set_result(parent, name_in_parent, nil, false, is_non_null_in_parent)
+        set_graphql_dead(selection_result)
+      end
+    elsif is_child_result
+      selection_result.set_child_result(result_name, value)
+    else
+      selection_result.set_leaf(result_name, value)
+    end
+  end
+end
+
+
+ +
+

+ + #tap_or_each(obj_or_array) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+65
+66
+67
+68
+69
+70
+71
+72
+73
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 65
+
+def tap_or_each(obj_or_array)
+  if obj_or_array.is_a?(Array)
+    obj_or_array.each do |item|
+      yield(item, true)
+    end
+  else
+    yield(obj_or_array, false)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/CurrentState.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/CurrentState.html new file mode 100644 index 0000000000..ef1e95d174 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/CurrentState.html @@ -0,0 +1,671 @@ + + + + + + + Class: GraphQL::Execution::Interpreter::Runtime::CurrentState + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Interpreter::Runtime::CurrentState + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter/runtime.rb
+
+ +
+ +
+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initializeCurrentState + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of CurrentState.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 13
+
+def initialize
+  @current_object = nil
+  @current_field = nil
+  @current_arguments = nil
+  @current_result_name = nil
+  @current_result = nil
+  @was_authorized_by_scope_items = nil
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #current_argumentsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 22
+
+def current_arguments
+  @current_arguments
+end
+
+
+ + + +
+

+ + #current_fieldObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 22
+
+def current_field
+  @current_field
+end
+
+
+ + + +
+

+ + #current_objectObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 22
+
+def current_object
+  @current_object
+end
+
+
+ + + +
+

+ + #current_resultObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 22
+
+def current_result
+  @current_result
+end
+
+
+ + + +
+

+ + #current_result_nameObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 22
+
+def current_result_name
+  @current_result_name
+end
+
+
+ + + +
+

+ + #was_authorized_by_scope_itemsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/execution/interpreter/runtime.rb', line 22
+
+def was_authorized_by_scope_items
+  @was_authorized_by_scope_items
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResult.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResult.html new file mode 100644 index 0000000000..1eaa1385a5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResult.html @@ -0,0 +1,751 @@ + + + + + + + Module: GraphQL::Execution::Interpreter::Runtime::GraphQLResult + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Execution::Interpreter::Runtime::GraphQLResult + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
GraphQLResultArray, GraphQLResultHash
+
+ + + +
+
Defined in:
+
lib/graphql/execution/interpreter/runtime/graphql_result.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #graphql_deadObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 28
+
+def graphql_dead
+  @graphql_dead
+end
+
+
+ + + +
+

+ + #graphql_is_non_null_in_parentObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 29
+
+def graphql_is_non_null_in_parent
+  @graphql_is_non_null_in_parent
+end
+
+
+ + + +
+

+ + #graphql_parentObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 29
+
+def graphql_parent
+  @graphql_parent
+end
+
+
+ + + +
+

+ + #graphql_result_dataHash + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Plain-Ruby result data (@graphql_metadata contains Result wrapper objects).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    Plain-Ruby result data (@graphql_metadata contains Result wrapper objects)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 32
+
+def graphql_result_data
+  @graphql_result_data
+end
+
+
+ + + +
+

+ + #graphql_result_nameObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 29
+
+def graphql_result_name
+  @graphql_result_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #build_path(path_array) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 23
+
+def build_path(path_array)
+  graphql_result_name && path_array.unshift(graphql_result_name)
+  @graphql_parent ? @graphql_parent.build_path(path_array) : path_array
+end
+
+
+ +
+

+ + #initialize(result_name, parent_result, is_non_null_in_parent) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 8
+
+def initialize(result_name, parent_result, is_non_null_in_parent)
+  @graphql_parent = parent_result
+  if parent_result && parent_result.graphql_dead
+    @graphql_dead = true
+  end
+  @graphql_result_name = result_name
+  @graphql_is_non_null_in_parent = is_non_null_in_parent
+  # Jump through some hoops to avoid creating this duplicate storage if at all possible.
+  @graphql_metadata = nil
+end
+
+
+ +
+

+ + #pathObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 19
+
+def path
+  @path ||= build_path([])
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResultArray.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResultArray.html new file mode 100644 index 0000000000..a423578371 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResultArray.html @@ -0,0 +1,560 @@ + + + + + + + Class: GraphQL::Execution::Interpreter::Runtime::GraphQLResultArray + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Interpreter::Runtime::GraphQLResultArray + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
GraphQLResult
+
+ + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter/runtime/graphql_result.rb
+
+ +
+ +
+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + +

Instance Attribute Summary

+ +

Attributes included from GraphQLResult

+

#graphql_dead, #graphql_is_non_null_in_parent, #graphql_parent, #graphql_result_data, #graphql_result_name

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from GraphQLResult

+

#build_path, #path

+
+

Constructor Details

+ +
+

+ + #initialize(_result_name, _parent_result, _is_non_null_in_parent) ⇒ GraphQLResultArray + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of GraphQLResultArray.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+124
+125
+126
+127
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 124
+
+def initialize(_result_name, _parent_result, _is_non_null_in_parent)
+  super
+  @graphql_result_data = []
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #graphql_skip_at(index) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 129
+
+def graphql_skip_at(index)
+  # Mark this index as dead. It's tricky because some indices may already be storing
+  # `Lazy`s. So the runtime is still holding indexes _before_ skipping,
+  # this object has to coordinate incoming writes to account for any already-skipped indices.
+  @skip_indices ||= []
+  @skip_indices << index
+  offset_by = @skip_indices.count { |skipped_idx| skipped_idx < index}
+  delete_at_index = index - offset_by
+  @graphql_metadata && @graphql_metadata.delete_at(delete_at_index)
+  @graphql_result_data.delete_at(delete_at_index)
+end
+
+
+ +
+

+ + #set_child_result(idx, value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 151
+
+def set_child_result(idx, value)
+  if @skip_indices
+    offset_by = @skip_indices.count { |skipped_idx| skipped_idx < idx }
+    idx -= offset_by
+  end
+  @graphql_result_data[idx] = value.graphql_result_data
+  # If we encounter some part of this response that requires metadata tracking,
+  # then create the metadata hash if necessary. It will be kept up-to-date after this.
+  (@graphql_metadata ||= @graphql_result_data.dup)[idx] = value
+  value
+end
+
+
+ +
+

+ + #set_leaf(idx, value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+141
+142
+143
+144
+145
+146
+147
+148
+149
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 141
+
+def set_leaf(idx, value)
+  if @skip_indices
+    offset_by = @skip_indices.count { |skipped_idx| skipped_idx < idx }
+    idx -= offset_by
+  end
+  @graphql_result_data[idx] = value
+  @graphql_metadata && @graphql_metadata[idx] = value
+  value
+end
+
+
+ +
+

+ + #valuesObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+163
+164
+165
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 163
+
+def values
+  (@graphql_metadata || @graphql_result_data)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResultHash.html b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResultHash.html new file mode 100644 index 0000000000..9930dcb396 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Interpreter/Runtime/GraphQLResultHash.html @@ -0,0 +1,965 @@ + + + + + + + Class: GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
GraphQLResult
+
+ + + + + + +
+
Defined in:
+
lib/graphql/execution/interpreter/runtime/graphql_result.rb
+
+ +
+ +
+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes included from GraphQLResult

+

#graphql_dead, #graphql_is_non_null_in_parent, #graphql_parent, #graphql_result_data, #graphql_result_name

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from GraphQLResult

+

#build_path, #path

+
+

Constructor Details

+ +
+

+ + #initialize(_result_name, _parent_result, _is_non_null_in_parent) ⇒ GraphQLResultHash + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of GraphQLResultHash.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+39
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 36
+
+def initialize(_result_name, _parent_result, _is_non_null_in_parent)
+  super
+  @graphql_result_data = {}
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #graphql_merged_intoObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+43
+44
+45
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 43
+
+def graphql_merged_into
+  @graphql_merged_into
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #[](k) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+93
+94
+95
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 93
+
+def [](k)
+  (@graphql_metadata || @graphql_result_data)[k]
+end
+
+
+ +
+

+ + #delete(key) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+76
+77
+78
+79
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 76
+
+def delete(key)
+  @graphql_metadata && @graphql_metadata.delete(key)
+  @graphql_result_data.delete(key)
+end
+
+
+ +
+

+ + #eachObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+81
+82
+83
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 81
+
+def each
+  (@graphql_metadata || @graphql_result_data).each { |k, v| yield(k, v) }
+end
+
+
+ +
+

+ + #key?(k) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+89
+90
+91
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 89
+
+def key?(k)
+  @graphql_result_data.key?(k)
+end
+
+
+ +
+

+ + #merge_into(into_result) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 97
+
+def merge_into(into_result)
+  self.each do |key, value|
+    case value
+    when GraphQLResultHash
+      next_into = into_result[key]
+      if next_into
+        value.merge_into(next_into)
+      else
+        into_result.set_child_result(key, value)
+      end
+    when GraphQLResultArray
+      # There's no special handling of arrays because currently, there's no way to split the execution
+      # of a list over several concurrent flows.
+      into_result.set_child_result(key, value)
+    else
+      # We have to assume that, since this passed the `fields_will_merge` selection,
+      # that the old and new values are the same.
+      into_result.set_leaf(key, value)
+    end
+  end
+  @graphql_merged_into = into_result
+end
+
+
+ +
+

+ + #set_child_result(key, value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 65
+
+def set_child_result(key, value)
+  if (t = @graphql_merged_into)
+    t.set_child_result(key, value)
+  end
+  @graphql_result_data[key] = value.graphql_result_data
+  # If we encounter some part of this response that requires metadata tracking,
+  # then create the metadata hash if necessary. It will be kept up-to-date after this.
+  (@graphql_metadata ||= @graphql_result_data.dup)[key] = value
+  value
+end
+
+
+ +
+

+ + #set_leaf(key, value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 45
+
+def set_leaf(key, value)
+  # This is a hack.
+  # Basically, this object is merged into the root-level result at some point.
+  # But the problem is, some lazies are created whose closures retain reference to _this_
+  # object. When those lazies are resolved, they cause an update to this object.
+  #
+  # In order to return a proper top-level result, we have to update that top-level result object.
+  # In order to return a proper partial result (eg, for a directive), we have to update this object, too.
+  # Yowza.
+  if (t = @graphql_merged_into)
+    t.set_leaf(key, value)
+  end
+
+  @graphql_result_data[key] = value
+  # keep this up-to-date if it's been initialized
+  @graphql_metadata && @graphql_metadata[key] = value
+
+  value
+end
+
+
+ +
+

+ + #valuesObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+85
+86
+87
+
+
# File 'lib/graphql/execution/interpreter/runtime/graphql_result.rb', line 85
+
+def values
+  (@graphql_metadata || @graphql_result_data).values
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Lazy.html b/api-doc/2.1.6/GraphQL/Execution/Lazy.html new file mode 100644 index 0000000000..6e01357b2a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Lazy.html @@ -0,0 +1,721 @@ + + + + + + + Class: GraphQL::Execution::Lazy + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Lazy + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/lazy.rb,
+ lib/graphql/execution/lazy/lazy_method_map.rb
+
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

This wraps a value which is available, but not yet calculated, like a promise or future.

+ +

Calling #value will trigger calculation & return the “lazy” value.

+ +

This is an itty-bitty promise-like object, with key differences: +- It has only two states, not-resolved and resolved +- It has no error-catching functionality

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: LazyMethodMap + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
NullResult = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+

This can be used for fields which had no lazy results

+ + +
+
+
+ + +
+
+
Lazy.new(){}
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #field ⇒ Object + + + + + + + + + readonly + + + + + + + private + + +
    +
    + +
  • + + +
+ + + + + +

+ Class Method Summary + collapse +

+ +
    + +
  • + + + .all(lazies) ⇒ Lazy + + + + + + + + + + + private + + +

    A lazy which will sync all of lazies.

    +
    + +
  • + + +
+ +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(field: nil, &get_value_func) ⇒ Lazy + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Create a GraphQL::Execution::Lazy which will get its inner value by calling the block

+ + +
+
+
+

Parameters:

+
    + +
  • + + field + + + (GraphQL::Schema::Field) + + + (defaults to: nil) + + +
  • + +
  • + + get_value_func + + + (Proc) + + + + — +

    a block to get the inner value (later)

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+20
+21
+22
+23
+24
+
+
# File 'lib/graphql/execution/lazy.rb', line 20
+
+def initialize(field: nil, &get_value_func)
+  @get_value_func = get_value_func
+  @resolved = false
+  @field = field
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #fieldObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/execution/lazy.rb', line 15
+
+def field
+  @field
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .all(lazies) ⇒ Lazy + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns A lazy which will sync all of lazies.

+ + +
+
+
+

Parameters:

+
    + +
  • + + lazies + + + (Array<Object>) + + + + — +

    Maybe-lazy objects

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Lazy) + + + + — +

    A lazy which will sync all of lazies

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+57
+58
+59
+60
+61
+
+
# File 'lib/graphql/execution/lazy.rb', line 57
+
+def self.all(lazies)
+  self.new {
+    lazies.map { |l| l.is_a?(Lazy) ? l.value : l }
+  }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #thenLazy + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns A GraphQL::Execution::Lazy whose value depends on another GraphQL::Execution::Lazy, plus any transformations in block.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+49
+50
+51
+52
+53
+
+
# File 'lib/graphql/execution/lazy.rb', line 49
+
+def then
+  self.class.new {
+    yield(value)
+  }
+end
+
+
+ +
+

+ + #valueObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns The wrapped value, calling the lazy block if necessary.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The wrapped value, calling the lazy block if necessary

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'lib/graphql/execution/lazy.rb', line 27
+
+def value
+  if !@resolved
+    @resolved = true
+    v = @get_value_func.call
+    if v.is_a?(Lazy)
+      v = v.value
+    end
+    @value = v
+  end
+
+  # `SKIP` was made into a subclass of `GraphQL::Error` to improve runtime performance
+  # (fewer clauses in a hot `case` block), but now it requires special handling here.
+  # I think it's still worth it for the performance win, but if the number of special
+  # cases grows, then maybe it's worth rethinking somehow.
+  if @value.is_a?(StandardError) && @value != GraphQL::Execution::SKIP
+    raise @value
+  else
+    @value
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Lazy/LazyMethodMap.html b/api-doc/2.1.6/GraphQL/Execution/Lazy/LazyMethodMap.html new file mode 100644 index 0000000000..ae4af813c4 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Lazy/LazyMethodMap.html @@ -0,0 +1,583 @@ + + + + + + + Class: GraphQL::Execution::Lazy::LazyMethodMap + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Lazy::LazyMethodMap + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/lazy/lazy_method_map.rb
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

Schema uses this to match returned values to lazy resolution methods. +Methods may be registered for classes, they apply to its subclasses also. +The result of this lookup is cached for future resolutions. +Instances of this class are thread-safe.

+ + +
+
+
+ + +

See Also:

+
    + +
  • looks up values from this map
  • + +
+ +

Defined Under Namespace

+

+ + + + + Classes: ConcurrentishMap + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(use_concurrent: defined?(Concurrent::Map)) ⇒ LazyMethodMap + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of LazyMethodMap.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/execution/lazy/lazy_method_map.rb', line 19
+
+def initialize(use_concurrent: defined?(Concurrent::Map))
+  @storage = use_concurrent ? Concurrent::Map.new : ConcurrentishMap.new
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #eachObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+39
+40
+41
+
+
# File 'lib/graphql/execution/lazy/lazy_method_map.rb', line 39
+
+def each
+  @storage.each_pair { |k, v| yield(k, v) }
+end
+
+
+ +
+

+ + #get(value) ⇒ Symbol? + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns The lazy_value_method for this object, or nil.

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +

    an object which may have a lazy_value_method registered for its class or superclasses

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Symbol, nil) + + + + — +

    The lazy_value_method for this object, or nil

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/graphql/execution/lazy/lazy_method_map.rb', line 35
+
+def get(value)
+  @storage.compute_if_absent(value.class) { find_superclass_method(value.class) }
+end
+
+
+ +
+

+ + #initialize_copy(other) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/graphql/execution/lazy/lazy_method_map.rb', line 23
+
+def initialize_copy(other)
+  @storage = other.storage.dup
+end
+
+
+ +
+

+ + #set(lazy_class, lazy_value_method) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+

Parameters:

+
    + +
  • + + lazy_class + + + (Class) + + + + — +

    A class which represents a lazy value (subclasses may also be used)

    +
    + +
  • + +
  • + + lazy_value_method + + + (Symbol) + + + + — +

    The method to call on this class to get its value

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/graphql/execution/lazy/lazy_method_map.rb', line 29
+
+def set(lazy_class, lazy_value_method)
+  @storage[lazy_class] = lazy_value_method
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Lazy/LazyMethodMap/ConcurrentishMap.html b/api-doc/2.1.6/GraphQL/Execution/Lazy/LazyMethodMap/ConcurrentishMap.html new file mode 100644 index 0000000000..94010ef6d5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Lazy/LazyMethodMap/ConcurrentishMap.html @@ -0,0 +1,448 @@ + + + + + + + Class: GraphQL::Execution::Lazy::LazyMethodMap::ConcurrentishMap + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Lazy::LazyMethodMap::ConcurrentishMap + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/execution/lazy/lazy_method_map.rb
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

Mock the Concurrent::Map API

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initializeConcurrentishMap + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of ConcurrentishMap.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+63
+64
+65
+66
+67
+68
+
+
# File 'lib/graphql/execution/lazy/lazy_method_map.rb', line 63
+
+def initialize
+  @semaphore = Mutex.new
+  # Access to this hash must always be managed by the mutex
+  # since it may be modified at runtime
+  @storage = {}
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #[]=(key, value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+70
+71
+72
+73
+74
+
+
# File 'lib/graphql/execution/lazy/lazy_method_map.rb', line 70
+
+def []=(key, value)
+  @semaphore.synchronize {
+    @storage[key] = value
+  }
+end
+
+
+ +
+

+ + #compute_if_absent(key) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+76
+77
+78
+79
+80
+
+
# File 'lib/graphql/execution/lazy/lazy_method_map.rb', line 76
+
+def compute_if_absent(key)
+  @semaphore.synchronize {
+    @storage.fetch(key) { @storage[key] = yield }
+  }
+end
+
+
+ +
+

+ + #initialize_copy(other) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+82
+83
+84
+85
+
+
# File 'lib/graphql/execution/lazy/lazy_method_map.rb', line 82
+
+def initialize_copy(other)
+  @semaphore = Mutex.new
+  @storage = other.copy_storage
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Lookahead.html b/api-doc/2.1.6/GraphQL/Execution/Lookahead.html new file mode 100644 index 0000000000..9244ae87da --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Lookahead.html @@ -0,0 +1,1569 @@ + + + + + + + Class: GraphQL::Execution::Lookahead + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Lookahead + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/lookahead.rb
+
+ +
+ +

Overview

+
+

Lookahead creates a uniform interface to inspect the forthcoming selections.

+ +

It assumes that the AST it’s working with is valid. (So, it’s safe to use +during execution, but if you’re using it directly, be sure to validate first.)

+ +

A field may get access to its lookahead by adding extras: [:lookahead] +to its configuration.

+ + +
+
+
+ +
+

Examples:

+ + +

looking ahead in a field

+

+ +
field :articles, [Types::Article], null: false,
+  extras: [:lookahead]
+
+# For example, imagine a faster database call
+# may be issued when only some fields are requested.
+#
+# Imagine that _full_ fetch must be made to satisfy `fullContent`,
+# we can look ahead to see if we need that field. If we do,
+# we make the expensive database call instead of the cheap one.
+def articles(lookahead:)
+  if lookahead.selects?(:full_content)
+    fetch_full_articles(object)
+  else
+    fetch_preview_articles(object)
+  end
+end
+ +
+ + +
+

Direct Known Subclasses

+

NullLookahead

+
+

Defined Under Namespace

+

+ + + + + Classes: NullLookahead + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
NULL_LOOKAHEAD = +
+
+

A singleton, so that misses don’t come with overhead.

+ + +
+
+
+ + +
+
+
NullLookahead.new
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(query:, ast_nodes:, field: nil, root_type: nil, owner_type: nil) ⇒ Lookahead + + + + + +

+
+

Returns a new instance of Lookahead.

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'lib/graphql/execution/lookahead.rb', line 34
+
+def initialize(query:, ast_nodes:, field: nil, root_type: nil, owner_type: nil)
+  @ast_nodes = ast_nodes.freeze
+  @field = field
+  @root_type = root_type
+  @query = query
+  @selected_type = @field ? @field.type.unwrap : root_type
+  @owner_type = owner_type
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #ast_nodesArray<GraphQL::Language::Nodes::Field> (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'lib/graphql/execution/lookahead.rb', line 44
+
+def ast_nodes
+  @ast_nodes
+end
+
+
+ + + +
+

+ + #fieldGraphQL::Schema::Field (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/execution/lookahead.rb', line 47
+
+def field
+  @field
+end
+
+
+ + + +
+

+ + #owner_typeGraphQL::Schema::Object, ... (readonly) + + + + + +

+
+ + + +
+
+ + + + + +
+
+
+
+50
+51
+52
+
+
# File 'lib/graphql/execution/lookahead.rb', line 50
+
+def owner_type
+  @owner_type
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #alias_selection(alias_name, selected_type: @selected_type, arguments: nil) ⇒ GraphQL::Execution::Lookahead + + + + + +

+
+

Like #selection, but for aliases. +It returns a null object (check with #selected?)

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+
+
# File 'lib/graphql/execution/lookahead.rb', line 140
+
+def alias_selection(alias_name, selected_type: @selected_type, arguments: nil)
+  alias_cache_key = [alias_name, arguments]
+  return alias_selections[key] if alias_selections.key?(alias_name)
+
+  alias_node = lookup_alias_node(ast_nodes, alias_name)
+  return NULL_LOOKAHEAD unless alias_node
+
+  next_field_defn = @query.get_field(selected_type, alias_node.name)
+
+  alias_arguments = @query.arguments_for(alias_node, next_field_defn)
+  if alias_arguments.is_a?(::GraphQL::Execution::Interpreter::Arguments)
+    alias_arguments = alias_arguments.keyword_arguments
+  end
+
+  return NULL_LOOKAHEAD if arguments && arguments != alias_arguments
+
+  alias_selections[alias_cache_key] = lookahead_for_selection(next_field_defn, selected_type, alias_arguments, alias_name)
+end
+
+
+ +
+

+ + #argumentsHash<Symbol, Object> + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<Symbol, Object>) + + + +
  • + +
+ +
+ + + + +
+
+
+
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+
+
# File 'lib/graphql/execution/lookahead.rb', line 53
+
+def arguments
+  if defined?(@arguments)
+    @arguments
+  else
+    @arguments = if @field
+      @query.after_lazy(@query.arguments_for(@ast_nodes.first, @field)) do |args|
+        args.is_a?(Execution::Interpreter::Arguments) ? args.keyword_arguments : args
+      end
+    else
+      nil
+    end
+  end
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+209
+210
+211
+
+
# File 'lib/graphql/execution/lookahead.rb', line 209
+
+def inspect
+  "#<GraphQL::Execution::Lookahead #{@field ? "@field=#{@field.path.inspect}": "@root_type=#{@root_type}"} @ast_nodes.size=#{@ast_nodes.size}>"
+end
+
+
+ +
+

+ + #nameSymbol + + + + + +

+
+

The method name of the field. +It returns the method_sym of the Lookahead’s field.

+ + +
+
+
+ +
+

Examples:

+ + +

getting the name of a selection

+

+ +
def articles(lookahead:)
+  article.selection(:full_content).name # => :full_content
+  # ...
+end
+ +
+ +

Returns:

+
    + +
  • + + + (Symbol) + + + +
  • + +
+ +
+ + + + +
+
+
+
+205
+206
+207
+
+
# File 'lib/graphql/execution/lookahead.rb', line 205
+
+def name
+  @field && @field.original_name
+end
+
+
+ +
+

+ + #selected?Boolean + + + + + +

+
+

Returns True if this lookahead represents a field that was requested.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if this lookahead represents a field that was requested

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'lib/graphql/execution/lookahead.rb', line 100
+
+def selected?
+  true
+end
+
+
+ +
+

+ + #selection(field_name, selected_type: @selected_type, arguments: nil) ⇒ GraphQL::Execution::Lookahead + + + + + +

+
+

Like #selects?, but can be used for chaining. +It returns a null object (check with #selected?)

+ + +
+
+
+

Parameters:

+
    + +
  • + + field_name + + + (String, Symbol) + + + +
  • + +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+
+
# File 'lib/graphql/execution/lookahead.rb', line 108
+
+def selection(field_name, selected_type: @selected_type, arguments: nil)
+  next_field_defn = case field_name
+  when String
+    @query.get_field(selected_type, field_name)
+  when Symbol
+    # Try to avoid the `.to_s` below, if possible
+    all_fields = if selected_type.kind.fields?
+      @query.warden.fields(selected_type)
+    else
+      # Handle unions by checking possible
+      @query.warden
+        .possible_types(selected_type)
+        .map { |t| @query.warden.fields(t) }
+        .tap(&:flatten!)
+    end
+
+
+    if (match_by_orig_name = all_fields.find { |f| f.original_name == field_name })
+      match_by_orig_name
+    else
+      # Symbol#name is only present on 3.0+
+      sym_s = field_name.respond_to?(:name) ? field_name.name : field_name.to_s
+      guessed_name = Schema::Member::BuildType.camelize(sym_s)
+      @query.get_field(selected_type, guessed_name)
+    end
+  end
+  lookahead_for_selection(next_field_defn, selected_type, arguments)
+end
+
+
+ +
+

+ + #selections(arguments: nil) ⇒ Array<GraphQL::Execution::Lookahead> + + + + + +

+
+

Like #selection, but for all nodes. +It returns a list of Lookaheads for all Selections

+ +

If arguments: is provided, each provided key/value will be matched +against the arguments in each selection. This method will filter the selections +if any of the given arguments: do not match the given selection.

+ + +
+
+
+ +
+

Examples:

+ + +

getting the name of a selection

+

+ +
def articles(lookahead:)
+  next_lookaheads = lookahead.selections # => [#<GraphQL::Execution::Lookahead ...>, ...]
+  next_lookaheads.map(&:name) #=> [:full_content, :title]
+end
+ +
+

Parameters:

+
    + +
  • + + arguments + + + (Hash) + + + (defaults to: nil) + + + — +

    Arguments which must match in the selection

    +
    + +
  • + +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+
+
# File 'lib/graphql/execution/lookahead.rb', line 174
+
+def selections(arguments: nil)
+  subselections_by_type = {}
+  subselections_on_type = subselections_by_type[@selected_type] = {}
+
+  @ast_nodes.each do |node|
+    find_selections(subselections_by_type, subselections_on_type, @selected_type, node.selections, arguments)
+  end
+
+  subselections = []
+
+  subselections_by_type.each do |type, ast_nodes_by_response_key|
+    ast_nodes_by_response_key.each do |response_key, ast_nodes|
+      field_defn = @query.get_field(type, ast_nodes.first.name)
+      lookahead = Lookahead.new(query: @query, ast_nodes: ast_nodes, field: field_defn, owner_type: type)
+      subselections.push(lookahead)
+    end
+  end
+
+  subselections
+end
+
+
+ +
+

+ + #selects?(field_name, selected_type: @selected_type, arguments: nil) ⇒ Boolean + + + + + +

+
+

True if this node has a selection on field_name. +If field_name is a String, it is treated as a GraphQL-style (camelized) +field name and used verbatim. If field_name is a Symbol, it is +treated as a Ruby-style (underscored) name and camelized before comparing.

+ +

If arguments: is provided, each provided key/value will be matched +against the arguments in the next selection. This method will return false +if any of the given arguments: are not present and matching in the next selection. +(But, the next selection may contain more than the given arguments.)

+ + +
+
+
+

Parameters:

+
    + +
  • + + field_name + + + (String, Symbol) + + + +
  • + +
  • + + arguments + + + (Hash) + + + (defaults to: nil) + + + — +

    Arguments which must match in the selection

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'lib/graphql/execution/lookahead.rb', line 79
+
+def selects?(field_name, selected_type: @selected_type, arguments: nil)
+  selection(field_name, selected_type: selected_type, arguments: arguments).selected?
+end
+
+
+ +
+

+ + #selects_alias?(alias_name, arguments: nil) ⇒ Boolean + + + + + +

+
+

True if this node has a selection with alias matching alias_name. +If alias_name is a String, it is treated as a GraphQL-style (camelized) +field name and used verbatim. If alias_name is a Symbol, it is +treated as a Ruby-style (underscored) name and camelized before comparing.

+ +

If arguments: is provided, each provided key/value will be matched +against the arguments in the next selection. This method will return false +if any of the given arguments: are not present and matching in the next selection. +(But, the next selection may contain more than the given arguments.)

+ + +
+
+
+

Parameters:

+
    + +
  • + + alias_name + + + (String, Symbol) + + + +
  • + +
  • + + arguments + + + (Hash) + + + (defaults to: nil) + + + — +

    Arguments which must match in the selection

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+95
+96
+97
+
+
# File 'lib/graphql/execution/lookahead.rb', line 95
+
+def selects_alias?(alias_name, arguments: nil)
+  alias_selection(alias_name, arguments: arguments).selected?
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Lookahead/NullLookahead.html b/api-doc/2.1.6/GraphQL/Execution/Lookahead/NullLookahead.html new file mode 100644 index 0000000000..0abaaa801a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Lookahead/NullLookahead.html @@ -0,0 +1,550 @@ + + + + + + + Class: GraphQL::Execution::Lookahead::NullLookahead + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Lookahead::NullLookahead + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Execution::Lookahead + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution/lookahead.rb
+
+ +
+ +

Overview

+
+

This is returned for #selection when a non-existent field is passed

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from GraphQL::Execution::Lookahead

+

NULL_LOOKAHEAD

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Execution::Lookahead

+

#ast_nodes, #field, #owner_type

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Execution::Lookahead

+

#alias_selection, #arguments, #name, #selects_alias?

+
+

Constructor Details

+ +
+

+ + #initializeNullLookahead + + + + + +

+
+

No inputs required here.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+216
+217
+
+
# File 'lib/graphql/execution/lookahead.rb', line 216
+
+def initialize
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+235
+236
+237
+
+
# File 'lib/graphql/execution/lookahead.rb', line 235
+
+def inspect
+  "#<GraphQL::Execution::Lookahead::NullLookahead>"
+end
+
+
+ +
+

+ + #selected?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+219
+220
+221
+
+
# File 'lib/graphql/execution/lookahead.rb', line 219
+
+def selected?
+  false
+end
+
+
+ +
+

+ + #selectionObject + + + + + +

+ + + + +
+
+
+
+227
+228
+229
+
+
# File 'lib/graphql/execution/lookahead.rb', line 227
+
+def selection(*)
+  NULL_LOOKAHEAD
+end
+
+
+ +
+

+ + #selectionsObject + + + + + +

+ + + + +
+
+
+
+231
+232
+233
+
+
# File 'lib/graphql/execution/lookahead.rb', line 231
+
+def selections(*)
+  []
+end
+
+
+ +
+

+ + #selects?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+223
+224
+225
+
+
# File 'lib/graphql/execution/lookahead.rb', line 223
+
+def selects?(*)
+  false
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Multiplex.html b/api-doc/2.1.6/GraphQL/Execution/Multiplex.html new file mode 100644 index 0000000000..b03210accc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Multiplex.html @@ -0,0 +1,737 @@ + + + + + + + Class: GraphQL::Execution::Multiplex + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Execution::Multiplex + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Tracing::Traceable
+
+ + + + + + +
+
Defined in:
+
lib/graphql/execution/multiplex.rb
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

Execute multiple queries under the same multiplex “umbrella”. +They can share a batching context and reduce redundant database hits.

+ +

The flow is:

+ +
    +
  • Multiplex instrumentation setup
  • +
  • Query instrumentation setup
  • +
  • Analyze the multiplex + each query
  • +
  • Begin each query
  • +
  • Resolve lazy values, breadth-first across all queries
  • +
  • Finish each query (eg, get errors)
  • +
  • Query instrumentation teardown
  • +
  • Multiplex instrumentation teardown
  • +
+ +

If one query raises an application error, all queries will be in undefined states.

+ +

Validation errors and GraphQL::ExecutionErrors are handled in isolation: +one of these errors in one query will not affect the other queries.

+ + +
+
+
+ + +

See Also:

+
    + +
  • for public API
  • + +
+ +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Tracing::Traceable

+

#trace

+
+

Constructor Details

+ +
+

+ + #initialize(schema:, queries:, context:, max_complexity:) ⇒ Multiplex + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of Multiplex.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
+
# File 'lib/graphql/execution/multiplex.rb', line 30
+
+def initialize(schema:, queries:, context:, max_complexity:)
+  @schema = schema
+  @queries = queries
+  @queries.each { |q| q.multiplex = self }
+  @context = context
+  @current_trace = @context[:trace] || schema.new_trace(multiplex: self)
+  @dataloader = @context[:dataloader] ||= @schema.dataloader_class.new
+  @tracers = schema.tracers + (context[:tracers] || [])
+  # Support `context: {backtrace: true}`
+  if context[:backtrace] && !@tracers.include?(GraphQL::Backtrace::Tracer)
+    @tracers << GraphQL::Backtrace::Tracer
+  end
+  @max_complexity = max_complexity
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #contextObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/execution/multiplex.rb', line 28
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #current_traceObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/execution/multiplex.rb', line 28
+
+def current_trace
+  @current_trace
+end
+
+
+ + + +
+

+ + #dataloaderObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/execution/multiplex.rb', line 28
+
+def dataloader
+  @dataloader
+end
+
+
+ + + +
+

+ + #max_complexityObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/execution/multiplex.rb', line 28
+
+def max_complexity
+  @max_complexity
+end
+
+
+ + + +
+

+ + #queriesObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/execution/multiplex.rb', line 28
+
+def queries
+  @queries
+end
+
+
+ + + +
+

+ + #schemaObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/execution/multiplex.rb', line 28
+
+def schema
+  @schema
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Execution/Skip.html b/api-doc/2.1.6/GraphQL/Execution/Skip.html new file mode 100644 index 0000000000..563ce96d89 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Execution/Skip.html @@ -0,0 +1,146 @@ + + + + + + + Exception: GraphQL::Execution::Skip + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Execution::Skip + + + Private +

+
+ +
+
Inherits:
+
+ GraphQL::Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution.rb
+
+ +
+ +
+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/ExecutionError.html b/api-doc/2.1.6/GraphQL/ExecutionError.html new file mode 100644 index 0000000000..d2c8ba8d19 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/ExecutionError.html @@ -0,0 +1,717 @@ + + + + + + + Exception: GraphQL::ExecutionError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::ExecutionError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/execution_error.rb
+
+ +
+ +

Overview

+
+

If a field’s resolve function returns a ExecutionError, +the error will be inserted into the response’s "errors" key +and the field will resolve to nil.

+ + +
+
+
+ + +
+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, ast_node: nil, options: nil, extensions: nil) ⇒ ExecutionError + + + + + +

+
+

Returns a new instance of ExecutionError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+
+
# File 'lib/graphql/execution_error.rb', line 24
+
+def initialize(message, ast_node: nil, options: nil, extensions: nil)
+  @ast_node = ast_node
+  @options = options
+  @extensions = extensions
+  super(message)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #ast_nodeGraphQL::Language::Nodes::Field + + + + + +

+
+

Returns the field where the error occurred.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/execution_error.rb', line 8
+
+def ast_node
+  @ast_node
+end
+
+
+ + + +
+

+ + #extensionsHash + + + + + +

+
+

under the extensions key.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    Optional custom data for error objects which will be added

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/execution_error.rb', line 22
+
+def extensions
+  @extensions
+end
+
+
+ + + +
+

+ + #optionsHash + + + + + +

+
+
Deprecated.

Use extensions instead of options. The GraphQL spec

+
+

recommends that any custom entries in an error be under the +extensions key.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    Optional data for error objects

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/graphql/execution_error.rb', line 18
+
+def options
+  @options
+end
+
+
+ + + +
+

+ + #pathString + + + + + +

+
+

response which corresponds to this error.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    an array describing the JSON-path into the execution

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/execution_error.rb', line 12
+
+def path
+  @path
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #to_hHash + + + + + +

+
+

Returns An entry for the response’s “errors” key.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    An entry for the response’s “errors” key

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+
+
# File 'lib/graphql/execution_error.rb', line 32
+
+def to_h
+  hash = {
+    "message" => message,
+  }
+  if ast_node
+    hash["locations"] = [
+      {
+        "line" => ast_node.line,
+        "column" => ast_node.col,
+      }
+    ]
+  end
+  if path
+    hash["path"] = path
+  end
+  if options
+    hash.merge!(options)
+  end
+  if extensions
+    hash["extensions"] = extensions.each_with_object({}) { |(key, value), ext|
+      ext[key.to_s] = value
+    }
+  end
+  hash
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/IntegerDecodingError.html b/api-doc/2.1.6/GraphQL/IntegerDecodingError.html new file mode 100644 index 0000000000..2cb493ca71 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/IntegerDecodingError.html @@ -0,0 +1,321 @@ + + + + + + + Exception: GraphQL::IntegerDecodingError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::IntegerDecodingError + + + +

+
+ +
+
Inherits:
+
+ RuntimeTypeError + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/integer_decoding_error.rb
+
+ +
+ +

Overview

+
+

This error is raised when Types::Int is given an input value outside of 32-bit integer range.

+ +

For really big integer values, consider GraphQL::Types::BigInt

+ + +
+
+
+ + +

See Also:

+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #integer_value ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    The value which couldn’t be decoded.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(value) ⇒ IntegerDecodingError + + + + + +

+
+

Returns a new instance of IntegerDecodingError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+12
+13
+14
+15
+
+
# File 'lib/graphql/integer_decoding_error.rb', line 12
+
+def initialize(value)
+  @integer_value = value
+  super("Integer out of bounds: #{value}. \nConsider using GraphQL::Types::BigInt instead.")
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #integer_valueObject (readonly) + + + + + +

+
+

The value which couldn’t be decoded

+ + +
+
+
+ + +
+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'lib/graphql/integer_decoding_error.rb', line 10
+
+def integer_value
+  @integer_value
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/IntegerEncodingError.html b/api-doc/2.1.6/GraphQL/IntegerEncodingError.html new file mode 100644 index 0000000000..0dda01e3b0 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/IntegerEncodingError.html @@ -0,0 +1,520 @@ + + + + + + + Exception: GraphQL::IntegerEncodingError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::IntegerEncodingError + + + +

+
+ +
+
Inherits:
+
+ RuntimeTypeError + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/integer_encoding_error.rb
+
+ +
+ +

Overview

+
+

This error is raised when Types::Int is asked to return a value outside of 32-bit integer range.

+ +

For values outside that range, consider:

+ +
    +
  • ID for database primary keys or other identifiers
  • +
  • GraphQL::Types::BigInt for really big integer values
  • +
+ + +
+
+
+ + +

See Also:

+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(value, context:) ⇒ IntegerEncodingError + + + + + +

+
+

Returns a new instance of IntegerEncodingError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'lib/graphql/integer_encoding_error.rb', line 21
+
+def initialize(value, context:)
+  @integer_value = value
+  @field = context[:current_field]
+  @path = context[:current_path]
+  message = "Integer out of bounds: #{value}".dup
+  if @path
+    message << " @ #{@path.join(".")}"
+  end
+  if @field
+    message << " (#{@field.path})"
+  end
+  message << ". Consider using ID or GraphQL::Types::BigInt instead."
+  super(message)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #fieldGraphQL::Schema::Field (readonly) + + + + + +

+
+

Returns The field that returned a too-big integer.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/integer_encoding_error.rb', line 16
+
+def field
+  @field
+end
+
+
+ + + +
+

+ + #integer_valueObject (readonly) + + + + + +

+
+

The value which couldn’t be encoded

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'lib/graphql/integer_encoding_error.rb', line 13
+
+def integer_value
+  @integer_value
+end
+
+
+ + + +
+

+ + #pathArray<String, Integer> (readonly) + + + + + +

+
+

Returns Where the field appeared in the GraphQL response.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<String, Integer>) + + + + — +

    Where the field appeared in the GraphQL response

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/integer_encoding_error.rb', line 19
+
+def path
+  @path
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection.html b/api-doc/2.1.6/GraphQL/Introspection.html new file mode 100644 index 0000000000..8bafd4b665 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection.html @@ -0,0 +1,409 @@ + + + + + + + Module: GraphQL::Introspection + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Introspection + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection.rb,
+ lib/graphql/introspection/type_type.rb,
lib/graphql/introspection/field_type.rb,
lib/graphql/introspection/base_object.rb,
lib/graphql/introspection/schema_type.rb,
lib/graphql/introspection/entry_points.rb,
lib/graphql/introspection/directive_type.rb,
lib/graphql/introspection/dynamic_fields.rb,
lib/graphql/introspection/type_kind_enum.rb,
lib/graphql/introspection/enum_value_type.rb,
lib/graphql/introspection/input_value_type.rb,
lib/graphql/introspection/directive_location_enum.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: BaseObject, DirectiveLocationEnum, DirectiveType, DynamicFields, EntryPoints, EnumValueType, FieldType, InputValueType, SchemaType, TypeKindEnum, TypeType + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
INTROSPECTION_QUERY = +
+
+

This query is used by graphql-client so don’t add the includeDeprecated +argument for inputFields since the server may not support it. Two stage +introspection queries will be required to handle this in clients.

+ + +
+
+
+ + +
+
+
GraphQL::Introspection.query
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .query(include_deprecated_args: false, include_schema_description: false, include_is_repeatable: false, include_specified_by_url: false, include_is_one_of: false) ⇒ Object + + + + + +

+ + + + +
+
+
+
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+
+
# File 'lib/graphql/introspection.rb', line 4
+
+def self.query(include_deprecated_args: false, include_schema_description: false, include_is_repeatable: false, include_specified_by_url: false, include_is_one_of: false)
+  # The introspection query to end all introspection queries, copied from
+  # https://github.com/graphql/graphql-js/blob/master/src/utilities/introspectionQuery.js
+  <<-QUERY.gsub(/\n{2,}/, "\n")
+query IntrospectionQuery {
+  __schema {
+#{include_schema_description ? "description" : ""}
+queryType { name }
+mutationType { name }
+subscriptionType { name }
+types {
+  ...FullType
+}
+directives {
+  name
+  description
+  locations
+  #{include_is_repeatable ? "isRepeatable" : ""}
+  args#{include_deprecated_args ? '(includeDeprecated: true)' : ''} {
+    ...InputValue
+  }
+}
+  }
+}
+fragment FullType on __Type {
+  kind
+  name
+  description
+  #{include_specified_by_url ? "specifiedByURL" : ""}
+  #{include_is_one_of ? "isOneOf" : ""}
+  fields(includeDeprecated: true) {
+name
+description
+args#{include_deprecated_args ? '(includeDeprecated: true)' : ''} {
+  ...InputValue
+}
+type {
+  ...TypeRef
+}
+isDeprecated
+deprecationReason
+  }
+  inputFields#{include_deprecated_args ? '(includeDeprecated: true)' : ''} {
+...InputValue
+  }
+  interfaces {
+...TypeRef
+  }
+  enumValues(includeDeprecated: true) {
+name
+description
+isDeprecated
+deprecationReason
+  }
+  possibleTypes {
+...TypeRef
+  }
+}
+fragment InputValue on __InputValue {
+  name
+  description
+  type { ...TypeRef }
+  defaultValue
+  #{include_deprecated_args ? 'isDeprecated' : ''}
+  #{include_deprecated_args ? 'deprecationReason' : ''}
+}
+fragment TypeRef on __Type {
+  kind
+  name
+  ofType {
+kind
+name
+ofType {
+  kind
+  name
+  ofType {
+    kind
+    name
+    ofType {
+      kind
+      name
+      ofType {
+        kind
+        name
+        ofType {
+          kind
+          name
+          ofType {
+            kind
+            name
+          }
+        }
+      }
+    }
+  }
+}
+  }
+}
+  QUERY
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/BaseObject.html b/api-doc/2.1.6/GraphQL/Introspection/BaseObject.html new file mode 100644 index 0000000000..9d43e2fe46 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/BaseObject.html @@ -0,0 +1,373 @@ + + + + + + + Class: GraphQL::Introspection::BaseObject + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::BaseObject + + + +

+
+ +
+
Inherits:
+
+ Schema::Object + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/base_object.rb
+
+ +
+ + + + + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+

Class Method Details

+ + +
+

+ + .field(*args, **kwargs, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/introspection/base_object.rb', line 7
+
+def self.field(*args, **kwargs, &block)
+  kwargs[:introspection] = true
+  super(*args, **kwargs, &block)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/DirectiveLocationEnum.html b/api-doc/2.1.6/GraphQL/Introspection/DirectiveLocationEnum.html new file mode 100644 index 0000000000..856ce94ca2 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/DirectiveLocationEnum.html @@ -0,0 +1,269 @@ + + + + + + + Class: GraphQL::Introspection::DirectiveLocationEnum + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::DirectiveLocationEnum + + + +

+
+ +
+
Inherits:
+
+ Schema::Enum + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/directive_location_enum.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from Schema::Enum

+

all_enum_value_definitions, coerce_input, coerce_result, enum_value_class, enum_values, kind, validate_non_null_input, value, values

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/DirectiveType.html b/api-doc/2.1.6/GraphQL/Introspection/DirectiveType.html new file mode 100644 index 0000000000..e3c01e5ad1 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/DirectiveType.html @@ -0,0 +1,384 @@ + + + + + + + Class: GraphQL::Introspection::DirectiveType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::DirectiveType + + + +

+
+ +
+
Inherits:
+
+ BaseObject + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/directive_type.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from BaseObject

+

field

+ + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #args(include_deprecated:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/introspection/directive_type.rb', line 24
+
+def args(include_deprecated:)
+  args = @context.warden.arguments(@object)
+  args = args.reject(&:deprecation_reason) unless include_deprecated
+  args
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/DynamicFields.html b/api-doc/2.1.6/GraphQL/Introspection/DynamicFields.html new file mode 100644 index 0000000000..16b037a878 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/DynamicFields.html @@ -0,0 +1,380 @@ + + + + + + + Class: GraphQL::Introspection::DynamicFields + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::DynamicFields + + + +

+
+ +
+
Inherits:
+
+ BaseObject + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/dynamic_fields.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from BaseObject

+

field

+ + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #__typenameObject + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/introspection/dynamic_fields.rb', line 7
+
+def __typename
+  object.class.graphql_name
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/EntryPoints.html b/api-doc/2.1.6/GraphQL/Introspection/EntryPoints.html new file mode 100644 index 0000000000..afe3ca0fcc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/EntryPoints.html @@ -0,0 +1,439 @@ + + + + + + + Class: GraphQL::Introspection::EntryPoints + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::EntryPoints + + + +

+
+ +
+
Inherits:
+
+ BaseObject + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/entry_points.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from BaseObject

+

field

+ + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #__schemaObject + + + + + +

+ + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+
+
# File 'lib/graphql/introspection/entry_points.rb', line 10
+
+def __schema
+  # Apply wrapping manually since this field isn't wrapped by instrumentation
+  schema = @context.query.schema
+  schema_type = schema.introspection_system.types["__Schema"]
+  schema_type.wrap(schema, @context)
+end
+
+
+ +
+

+ + #__type(name:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/introspection/entry_points.rb', line 17
+
+def __type(name:)
+  context.warden.reachable_type?(name) ? context.warden.get_type(name) : nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/EnumValueType.html b/api-doc/2.1.6/GraphQL/Introspection/EnumValueType.html new file mode 100644 index 0000000000..6acf49eeed --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/EnumValueType.html @@ -0,0 +1,433 @@ + + + + + + + Class: GraphQL::Introspection::EnumValueType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::EnumValueType + + + +

+
+ +
+
Inherits:
+
+ BaseObject + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/enum_value_type.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from BaseObject

+

field

+ + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #is_deprecatedObject + + + + + +

+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/graphql/introspection/enum_value_type.rb', line 18
+
+def is_deprecated
+  !!@object.deprecation_reason
+end
+
+
+ +
+

+ + #nameObject + + + + + +

+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/introspection/enum_value_type.rb', line 14
+
+def name
+  object.graphql_name
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/FieldType.html b/api-doc/2.1.6/GraphQL/Introspection/FieldType.html new file mode 100644 index 0000000000..5452f6b866 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/FieldType.html @@ -0,0 +1,437 @@ + + + + + + + Class: GraphQL::Introspection::FieldType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::FieldType + + + +

+
+ +
+
Inherits:
+
+ BaseObject + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/field_type.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from BaseObject

+

field

+ + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #args(include_deprecated:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/introspection/field_type.rb', line 21
+
+def args(include_deprecated:)
+  args = @context.warden.arguments(@object)
+  args = args.reject(&:deprecation_reason) unless include_deprecated
+  args
+end
+
+
+ +
+

+ + #is_deprecatedObject + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/introspection/field_type.rb', line 17
+
+def is_deprecated
+  !!@object.deprecation_reason
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/InputValueType.html b/api-doc/2.1.6/GraphQL/Introspection/InputValueType.html new file mode 100644 index 0000000000..034011942d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/InputValueType.html @@ -0,0 +1,465 @@ + + + + + + + Class: GraphQL::Introspection::InputValueType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::InputValueType + + + +

+
+ +
+
Inherits:
+
+ BaseObject + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/input_value_type.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from BaseObject

+

field

+ + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #default_valueObject + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
+
# File 'lib/graphql/introspection/input_value_type.rb', line 20
+
+def default_value
+  if @object.default_value?
+    value = @object.default_value
+    if value.nil?
+      'null'
+    else
+      if (@object.type.kind.list? || (@object.type.kind.non_null? && @object.type.of_type.kind.list?)) && !value.respond_to?(:map)
+        # This is a bit odd -- we expect the default value to be an application-style value, so we use coerce result below.
+        # But coerce_result doesn't wrap single-item lists, which are valid inputs to list types.
+        # So, apply that wrapper here if needed.
+        value = [value]
+      end
+      coerced_default_value = @object.type.coerce_result(value, @context)
+      serialize_default_value(coerced_default_value, @object.type)
+    end
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #is_deprecatedObject + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/introspection/input_value_type.rb', line 16
+
+def is_deprecated
+  !!@object.deprecation_reason
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/SchemaType.html b/api-doc/2.1.6/GraphQL/Introspection/SchemaType.html new file mode 100644 index 0000000000..4f70486f36 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/SchemaType.html @@ -0,0 +1,645 @@ + + + + + + + Class: GraphQL::Introspection::SchemaType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::SchemaType + + + +

+
+ +
+
Inherits:
+
+ BaseObject + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/schema_type.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from BaseObject

+

field

+ + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #directivesObject + + + + + +

+ + + + +
+
+
+
+38
+39
+40
+
+
# File 'lib/graphql/introspection/schema_type.rb', line 38
+
+def directives
+  @context.warden.directives
+end
+
+
+ +
+

+ + #mutation_typeObject + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/introspection/schema_type.rb', line 30
+
+def mutation_type
+  permitted_root_type("mutation")
+end
+
+
+ +
+

+ + #query_typeObject + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/introspection/schema_type.rb', line 26
+
+def query_type
+  permitted_root_type("query")
+end
+
+
+ +
+

+ + #schema_descriptionObject + + + + + +

+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/graphql/introspection/schema_type.rb', line 18
+
+def schema_description
+  context.schema.description
+end
+
+
+ +
+

+ + #subscription_typeObject + + + + + +

+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'lib/graphql/introspection/schema_type.rb', line 34
+
+def subscription_type
+  permitted_root_type("subscription")
+end
+
+
+ +
+

+ + #typesObject + + + + + +

+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/introspection/schema_type.rb', line 22
+
+def types
+  @context.warden.reachable_types.sort_by(&:graphql_name)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/TypeKindEnum.html b/api-doc/2.1.6/GraphQL/Introspection/TypeKindEnum.html new file mode 100644 index 0000000000..16c6aef978 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/TypeKindEnum.html @@ -0,0 +1,269 @@ + + + + + + + Class: GraphQL::Introspection::TypeKindEnum + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::TypeKindEnum + + + +

+
+ +
+
Inherits:
+
+ Schema::Enum + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/type_kind_enum.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from Schema::Enum

+

all_enum_value_definitions, coerce_input, coerce_result, enum_value_class, enum_values, kind, validate_non_null_input, value, values

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Introspection/TypeType.html b/api-doc/2.1.6/GraphQL/Introspection/TypeType.html new file mode 100644 index 0000000000..d3c1d29911 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Introspection/TypeType.html @@ -0,0 +1,878 @@ + + + + + + + Class: GraphQL::Introspection::TypeType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Introspection::TypeType + + + +

+
+ +
+
Inherits:
+
+ BaseObject + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/introspection/type_type.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from BaseObject

+

field

+ + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #enum_values(include_deprecated:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'lib/graphql/introspection/type_type.rb', line 51
+
+def enum_values(include_deprecated:)
+  if !@object.kind.enum?
+    nil
+  else
+    enum_values = @context.warden.enum_values(@object)
+
+    if !include_deprecated
+      enum_values = enum_values.select {|f| !f.deprecation_reason }
+    end
+
+    enum_values
+  end
+end
+
+
+ +
+

+ + #fields(include_deprecated:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+
+
# File 'lib/graphql/introspection/type_type.rb', line 91
+
+def fields(include_deprecated:)
+  if !@object.kind.fields?
+    nil
+  else
+    fields = @context.warden.fields(@object)
+    if !include_deprecated
+      fields = fields.select {|f| !f.deprecation_reason }
+    end
+    fields.sort_by(&:name)
+  end
+end
+
+
+ +
+

+ + #input_fields(include_deprecated:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+73
+74
+75
+76
+77
+78
+79
+80
+81
+
+
# File 'lib/graphql/introspection/type_type.rb', line 73
+
+def input_fields(include_deprecated:)
+  if @object.kind.input_object?
+    args = @context.warden.arguments(@object)
+    args = args.reject(&:deprecation_reason) unless include_deprecated
+    args
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #interfacesObject + + + + + +

+ + + + +
+
+
+
+65
+66
+67
+68
+69
+70
+71
+
+
# File 'lib/graphql/introspection/type_type.rb', line 65
+
+def interfaces
+  if @object.kind.object? || @object.kind.interface?
+    @context.warden.interfaces(@object).sort_by(&:graphql_name)
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #is_one_ofObject + + + + + +

+ + + + +
+
+
+
+34
+35
+36
+37
+
+
# File 'lib/graphql/introspection/type_type.rb', line 34
+
+def is_one_of
+  object.kind.input_object? &&
+    object.directives.any? { |d| d.graphql_name == "oneOf" }
+end
+
+
+ +
+

+ + #kindObject + + + + + +

+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/introspection/type_type.rb', line 47
+
+def kind
+  @object.kind.name
+end
+
+
+ +
+

+ + #of_typeObject + + + + + +

+ + + + +
+
+
+
+103
+104
+105
+
+
# File 'lib/graphql/introspection/type_type.rb', line 103
+
+def of_type
+  @object.kind.wraps? ? @object.of_type : nil
+end
+
+
+ +
+

+ + #possible_typesObject + + + + + +

+ + + + +
+
+
+
+83
+84
+85
+86
+87
+88
+89
+
+
# File 'lib/graphql/introspection/type_type.rb', line 83
+
+def possible_types
+  if @object.kind.abstract?
+    @context.warden.possible_types(@object).sort_by(&:graphql_name)
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #specified_by_urlObject + + + + + +

+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/graphql/introspection/type_type.rb', line 39
+
+def specified_by_url
+  if object.kind.scalar?
+    object.specified_by_url
+  else
+    nil
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/InvalidNameError.html b/api-doc/2.1.6/GraphQL/InvalidNameError.html new file mode 100644 index 0000000000..31b22ee602 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/InvalidNameError.html @@ -0,0 +1,384 @@ + + + + + + + Exception: GraphQL::InvalidNameError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::InvalidNameError + + + +

+
+ +
+
Inherits:
+
+ ExecutionError + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/invalid_name_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute name.

    +
    + +
  • + + +
  • + + + #valid_regex ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute valid_regex.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from ExecutionError

+

#ast_node, #extensions, #options, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from ExecutionError

+

#to_h

+ + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(name, valid_regex) ⇒ InvalidNameError + + + + + +

+
+

Returns a new instance of InvalidNameError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+8
+9
+
+
# File 'lib/graphql/invalid_name_error.rb', line 5
+
+def initialize(name, valid_regex)
+  @name = name
+  @valid_regex = valid_regex
+  super("Names must match #{@valid_regex.inspect} but '#{@name}' does not")
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nameObject (readonly) + + + + + +

+
+

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/graphql/invalid_name_error.rb', line 4
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #valid_regexObject (readonly) + + + + + +

+
+

Returns the value of attribute valid_regex.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/graphql/invalid_name_error.rb', line 4
+
+def valid_regex
+  @valid_regex
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/InvalidNullError.html b/api-doc/2.1.6/GraphQL/InvalidNullError.html new file mode 100644 index 0000000000..e3b9afacc7 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/InvalidNullError.html @@ -0,0 +1,883 @@ + + + + + + + Exception: GraphQL::InvalidNullError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::InvalidNullError + + + +

+
+ +
+
Inherits:
+
+ RuntimeTypeError + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/invalid_null_error.rb
+
+ +
+ +

Overview

+
+

Raised automatically when a field’s resolve function returns nil +for a non-null field.

+ + +
+
+
+ + +
+ + + +

Class Attribute Summary collapse

+
    + +
  • + + + .parent_class ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute parent_class.

    +
    + +
  • + + +
+ +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(parent_type, field, value) ⇒ InvalidNullError + + + + + +

+
+

Returns a new instance of InvalidNullError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+
+
# File 'lib/graphql/invalid_null_error.rb', line 15
+
+def initialize(parent_type, field, value)
+  @parent_type = parent_type
+  @field = field
+  @value = value
+  super("Cannot return null for non-nullable field #{@parent_type.graphql_name}.#{@field.graphql_name}")
+end
+
+
+ +
+ +
+

Class Attribute Details

+ + + +
+

+ + .parent_classObject + + + + + +

+
+

Returns the value of attribute parent_class.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/invalid_null_error.rb', line 33
+
+def parent_class
+  @parent_class
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #fieldGraphQL::Field (readonly) + + + + + +

+
+

Returns The field which failed to return a value.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Field) + + + + — +

    The field which failed to return a value

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'lib/graphql/invalid_null_error.rb', line 10
+
+def field
+  @field
+end
+
+
+ + + +
+

+ + #parent_typeGraphQL::BaseType (readonly) + + + + + +

+
+

Returns The owner of #field.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::BaseType) + + + + — +

    The owner of #field

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/invalid_null_error.rb', line 7
+
+def parent_type
+  @parent_type
+end
+
+
+ + + +
+

+ + #valuenil, GraphQL::ExecutionError (readonly) + + + + + +

+
+

Returns The invalid value for this field.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'lib/graphql/invalid_null_error.rb', line 13
+
+def value
+  @value
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .inspectObject + + + + + +

+ + + + +
+
+
+
+41
+42
+43
+44
+45
+46
+47
+
+
# File 'lib/graphql/invalid_null_error.rb', line 41
+
+def inspect
+  if (name.nil? || parent_class.name.nil?) && parent_class.respond_to?(:mutation) && (mutation = parent_class.mutation)
+    "#{mutation.inspect}::#{parent_class.graphql_name}::InvalidNullError"
+  else
+    super
+  end
+end
+
+
+ +
+

+ + .subclass_for(parent_class) ⇒ Object + + + + + +

+ + + + +
+
+
+
+35
+36
+37
+38
+39
+
+
# File 'lib/graphql/invalid_null_error.rb', line 35
+
+def subclass_for(parent_class)
+  subclass = Class.new(self)
+  subclass.parent_class = parent_class
+  subclass
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #parent_error?Boolean + + + + + +

+
+
Deprecated.

always false

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/invalid_null_error.rb', line 28
+
+def parent_error?
+  false
+end
+
+
+ +
+

+ + #to_hHash + + + + + +

+
+

Returns An entry for the response’s “errors” key.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    An entry for the response’s “errors” key

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/graphql/invalid_null_error.rb', line 23
+
+def to_h
+  { "message" => message }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/InvariantError.html b/api-doc/2.1.6/GraphQL/InvariantError.html new file mode 100644 index 0000000000..d949cbb4c4 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/InvariantError.html @@ -0,0 +1,229 @@ + + + + + + + Exception: GraphQL::InvariantError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::InvariantError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql.rb
+
+ +
+ +

Overview

+
+

This error is raised when GraphQL-Ruby encounters a situation +that it thought would never happen. Please report this bug!

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message) ⇒ InvariantError + + + + + +

+
+

Returns a new instance of InvariantError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql.rb', line 23
+
+def initialize(message)
+  message += "
+
+This is probably a bug in GraphQL-Ruby, please report this error on GitHub: https://github.com/rmosolgo/graphql-ruby/issues/new?template=bug_report.md"
+  super(message)
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language.html b/api-doc/2.1.6/GraphQL/Language.html new file mode 100644 index 0000000000..9ff7e7fb45 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language.html @@ -0,0 +1,236 @@ + + + + + + + Module: GraphQL::Language + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Language + + + +

+
+ + + + + + + + + +
+
Included in:
+
StaticValidation::DirectivesAreInValidLocations
+
+ + + +
+
Defined in:
+
lib/graphql/language.rb,
+ lib/graphql/language/cache.rb,
lib/graphql/language/lexer.rb,
lib/graphql/language/nodes.rb,
lib/graphql/language/token.rb,
lib/graphql/language/parser.rb,
lib/graphql/language/printer.rb,
lib/graphql/language/visitor.rb,
lib/graphql/language/generation.rb,
lib/graphql/language/block_string.rb,
lib/graphql/language/static_visitor.rb,
lib/graphql/language/definition_slice.rb,
lib/graphql/language/sanitized_printer.rb,
lib/graphql/language/document_from_schema_definition.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: BlockString, DefinitionSlice, Generation, Nodes + + + + Classes: Cache, DocumentFromSchemaDefinition, Lexer, Parser, Printer, SanitizedPrinter, StaticVisitor, Token, Visitor + + +

+ + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .serialize(value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
+
# File 'lib/graphql/language.rb', line 19
+
+def self.serialize(value)
+  if value.is_a?(Hash)
+    serialized_hash = value.map do |k, v|
+      "#{k}:#{serialize v}"
+    end.join(",")
+
+    "{#{serialized_hash}}"
+  elsif value.is_a?(Array)
+    serialized_array = value.map do |v|
+      serialize v
+    end.join(",")
+
+    "[#{serialized_array}]"
+  else
+    JSON.generate(value, quirks_mode: true)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/BlockString.html b/api-doc/2.1.6/GraphQL/Language/BlockString.html new file mode 100644 index 0000000000..be665df5c5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/BlockString.html @@ -0,0 +1,393 @@ + + + + + + + Module: GraphQL::Language::BlockString + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Language::BlockString + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/block_string.rb
+
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+ + + + + +
+
+
+
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+
+
# File 'lib/graphql/language/block_string.rb', line 61
+
+def self.print(str, indent: '')
+  line_length = 120 - indent.length
+  block_str = "".dup
+  triple_quotes = "\"\"\"\n"
+  block_str << indent
+  block_str << triple_quotes
+
+  if str.include?("\n")
+    str.split("\n") do |line|
+      if line == ''
+        block_str << "\n"
+      else
+        break_line(line, line_length) do |subline|
+          block_str << indent
+          block_str << subline
+          block_str << "\n"
+        end
+      end
+    end
+  else
+    break_line(str, line_length) do |subline|
+      block_str << indent
+      block_str << subline
+      block_str << "\n"
+    end
+  end
+
+  block_str << indent
+  block_str << triple_quotes
+end
+
+
+ +
+

+ + .trim_whitespace(str) ⇒ Object + + + + + +

+
+

Remove leading and trailing whitespace from a block string. +See “Block Strings” in https://github.com/facebook/graphql/blob/master/spec/Section%202%20–%20Language.md

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
+
# File 'lib/graphql/language/block_string.rb', line 7
+
+def self.trim_whitespace(str)
+  # Early return for the most common cases:
+  if str == ""
+    return "".dup
+  elsif !(has_newline = str.include?("\n")) && !(str.start_with?(" "))
+    return str
+  end
+
+  lines = has_newline ? str.split("\n") : [str]
+  common_indent = nil
+
+  # find the common whitespace
+  lines.each_with_index do |line, idx|
+    if idx == 0
+      next
+    end
+    line_length = line.size
+    line_indent = if line.match?(/\A  [^ ]/)
+      2
+    elsif line.match?(/\A    [^ ]/)
+      4
+    elsif line.match?(/\A[^ ]/)
+      0
+    else
+      line[/\A */].size
+    end
+    if line_indent < line_length && (common_indent.nil? || line_indent < common_indent)
+      common_indent = line_indent
+    end
+  end
+
+  # Remove the common whitespace
+  if common_indent && common_indent > 0
+    lines.each_with_index do |line, idx|
+      if idx == 0
+        next
+      else
+        line.slice!(0, common_indent)
+      end
+    end
+  end
+
+  # Remove leading & trailing blank lines
+  while lines.size > 0 && lines[0].empty?
+    lines.shift
+  end
+  while lines.size > 0 && lines[-1].empty?
+    lines.pop
+  end
+
+  # Rebuild the string
+  lines.size > 1 ? lines.join("\n") : (lines.first || "".dup)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Cache.html b/api-doc/2.1.6/GraphQL/Language/Cache.html new file mode 100644 index 0000000000..db4beb9f50 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Cache.html @@ -0,0 +1,312 @@ + + + + + + + Class: GraphQL::Language::Cache + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Cache + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/cache.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
DIGEST = + +
+
Digest::SHA256.new << GraphQL::VERSION
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(path) ⇒ Cache + + + + + +

+
+

Returns a new instance of Cache.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/language/cache.rb', line 9
+
+def initialize(path)
+  @path = path
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #fetch(filename) ⇒ Object + + + + + +

+ + + + +
+
+
+
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'lib/graphql/language/cache.rb', line 14
+
+def fetch(filename)
+  hash = DIGEST.dup << filename
+  begin
+    hash << File.mtime(filename).to_i.to_s
+  rescue SystemCallError
+    return yield
+  end
+  cache_path = @path.join(hash.to_s)
+
+  if cache_path.exist?
+    Marshal.load(cache_path.read)
+  else
+    payload = yield
+    tmp_path = "#{cache_path}.#{rand}"
+
+    @path.mkpath
+    File.binwrite(tmp_path, Marshal.dump(payload))
+    File.rename(tmp_path, cache_path.to_s)
+    payload
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/DefinitionSlice.html b/api-doc/2.1.6/GraphQL/Language/DefinitionSlice.html new file mode 100644 index 0000000000..4cb59018fe --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/DefinitionSlice.html @@ -0,0 +1,205 @@ + + + + + + + Module: GraphQL::Language::DefinitionSlice + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Language::DefinitionSlice + + + +

+
+ + + + +
+
Extended by:
+
DefinitionSlice
+
+ + + + + + +
+
Included in:
+
DefinitionSlice
+
+ + + +
+
Defined in:
+
lib/graphql/language/definition_slice.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: DependencyVisitor + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #slice(document, name) ⇒ Object + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/language/definition_slice.rb', line 7
+
+def slice(document, name)
+  definitions = {}
+  document.definitions.each { |d| definitions[d.name] = d }
+  names = Set.new
+  DependencyVisitor.find_definition_dependencies(definitions, name, names)
+  definitions = document.definitions.select { |d| names.include?(d.name) }
+  Nodes::Document.new(definitions: definitions)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/DefinitionSlice/DependencyVisitor.html b/api-doc/2.1.6/GraphQL/Language/DefinitionSlice/DependencyVisitor.html new file mode 100644 index 0000000000..aa5b8c6a8e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/DefinitionSlice/DependencyVisitor.html @@ -0,0 +1,357 @@ + + + + + + + Class: GraphQL::Language::DefinitionSlice::DependencyVisitor + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::DefinitionSlice::DependencyVisitor + + + +

+
+ +
+
Inherits:
+
+ StaticVisitor + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/definition_slice.rb
+
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from StaticVisitor

+

make_visit_methods, #on_argument_children, #on_document_children, #on_field_children, #on_fragment_definition_children, #on_operation_definition_children, #visit, #visit_directives, #visit_selections

+
+

Constructor Details

+ +
+

+ + #initialize(doc, definitions, names) ⇒ DependencyVisitor + + + + + +

+
+

Returns a new instance of DependencyVisitor.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+
+
# File 'lib/graphql/language/definition_slice.rb', line 19
+
+def initialize(doc, definitions, names)
+  @names = names
+  @definitions = definitions
+  super(doc)
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .find_definition_dependencies(definitions, name, names) ⇒ Object + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+
+
# File 'lib/graphql/language/definition_slice.rb', line 32
+
+def self.find_definition_dependencies(definitions, name, names)
+  names.add(name)
+  visitor = self.new(definitions[name], definitions, names)
+  visitor.visit
+  nil
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #on_fragment_spread(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+
+
# File 'lib/graphql/language/definition_slice.rb', line 25
+
+def on_fragment_spread(node, parent)
+  if fragment = @definitions[node.name]
+    self.class.find_definition_dependencies(@definitions, fragment.name, @names)
+  end
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/DocumentFromSchemaDefinition.html b/api-doc/2.1.6/GraphQL/Language/DocumentFromSchemaDefinition.html new file mode 100644 index 0000000000..21f739e517 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/DocumentFromSchemaDefinition.html @@ -0,0 +1,2092 @@ + + + + + + + Class: GraphQL::Language::DocumentFromSchemaDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::DocumentFromSchemaDefinition + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/document_from_schema_definition.rb
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

DocumentFromSchemaDefinition is used to convert a Schema object +To a Document AST node.

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(schema, context: nil, include_introspection_types: false, include_built_in_directives: false, include_built_in_scalars: false, always_include_schema: false) ⇒ DocumentFromSchemaDefinition + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of DocumentFromSchemaDefinition.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 16
+
+def initialize(
+  schema, context: nil, include_introspection_types: false,
+  include_built_in_directives: false, include_built_in_scalars: false, always_include_schema: false
+)
+  @schema = schema
+  @always_include_schema = always_include_schema
+  @include_introspection_types = include_introspection_types
+  @include_built_in_scalars = include_built_in_scalars
+  @include_built_in_directives = include_built_in_directives
+  @include_one_of = false
+
+  schema_context = schema.context_class.new(query: nil, object: nil, schema: schema, values: context)
+
+
+  @warden = @schema.warden_class.new(
+    schema: @schema,
+    context: schema_context,
+  )
+
+  schema_context.warden = @warden
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #build_argument_node(argument) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 131
+
+def build_argument_node(argument)
+  if argument.default_value?
+    default_value = build_default_value(argument.default_value, argument.type)
+  else
+    default_value = nil
+  end
+
+  argument_node = GraphQL::Language::Nodes::InputValueDefinition.new(
+    name: argument.graphql_name,
+    description: argument.description,
+    type: build_type_name_node(argument.type),
+    default_value: default_value,
+    directives: directives(argument),
+  )
+
+  argument_node
+end
+
+
+ +
+

+ + #build_argument_nodes(arguments) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+246
+247
+248
+249
+250
+251
+252
+253
+254
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 246
+
+def build_argument_nodes(arguments)
+  if arguments.any?
+    nodes = arguments.map { |arg| build_argument_node(arg) }
+    nodes.sort_by!(&:name)
+    nodes
+  else
+    arguments
+  end
+end
+
+
+ +
+

+ + #build_default_value(default_value, type) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 194
+
+def build_default_value(default_value, type)
+  if default_value.nil?
+    return GraphQL::Language::Nodes::NullValue.new(name: "null")
+  end
+
+  case type.kind.name
+  when "SCALAR"
+    type.coerce_isolated_result(default_value)
+  when "ENUM"
+    GraphQL::Language::Nodes::Enum.new(name: type.coerce_isolated_result(default_value))
+  when "INPUT_OBJECT"
+    GraphQL::Language::Nodes::InputObject.new(
+      arguments: default_value.to_h.map do |arg_name, arg_value|
+        args = @warden.arguments(type)
+        arg = args.find { |a| a.keyword.to_s == arg_name.to_s }
+        if arg.nil?
+          raise ArgumentError, "No argument definition on #{type.graphql_name} for argument: #{arg_name.inspect} (expected one of: #{args.map(&:keyword)})"
+        end
+        GraphQL::Language::Nodes::Argument.new(
+          name: arg.graphql_name.to_s,
+          value: build_default_value(arg_value, arg.type)
+        )
+      end
+    )
+  when "NON_NULL"
+    build_default_value(default_value, type.of_type)
+  when "LIST"
+    default_value.to_a.map { |v| build_default_value(v, type.of_type) }
+  else
+    raise GraphQL::RequiredImplementationMissingError, "Unexpected default value type #{type.inspect}"
+  end
+end
+
+
+ +
+

+ + #build_definition_nodesObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 262
+
+def build_definition_nodes
+  dirs_to_build = warden.directives
+  if !include_built_in_directives
+    dirs_to_build = dirs_to_build.reject { |directive| directive.default_directive? }
+  end
+  definitions = build_directive_nodes(dirs_to_build)
+
+  type_nodes = build_type_definition_nodes(warden.reachable_types)
+
+  if @include_one_of
+    # This may have been set to true when iterating over all types
+    definitions.concat(build_directive_nodes([GraphQL::Schema::Directive::OneOf]))
+  end
+
+  definitions.concat(type_nodes)
+  if include_schema_node?
+    definitions.unshift(build_schema_node)
+  end
+
+  definitions
+end
+
+
+ +
+

+ + #build_directive_location_node(location) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+172
+173
+174
+175
+176
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 172
+
+def build_directive_location_node(location)
+  GraphQL::Language::Nodes::DirectiveLocation.new(
+    name: location.to_s
+  )
+end
+
+
+ +
+

+ + #build_directive_location_nodes(locations) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+168
+169
+170
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 168
+
+def build_directive_location_nodes(locations)
+  locations.sort.map { |location| build_directive_location_node(location) }
+end
+
+
+ +
+

+ + #build_directive_node(directive) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+158
+159
+160
+161
+162
+163
+164
+165
+166
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 158
+
+def build_directive_node(directive)
+  GraphQL::Language::Nodes::DirectiveDefinition.new(
+    name: directive.graphql_name,
+    repeatable: directive.repeatable?,
+    arguments: build_argument_nodes(warden.arguments(directive)),
+    locations: build_directive_location_nodes(directive.locations),
+    description: directive.description,
+  )
+end
+
+
+ +
+

+ + #build_directive_nodes(directives) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+256
+257
+258
+259
+260
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 256
+
+def build_directive_nodes(directives)
+  directives
+    .map { |directive| build_directive_node(directive) }
+    .sort_by(&:name)
+end
+
+
+ +
+

+ + #build_enum_type_node(enum_type) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 104
+
+def build_enum_type_node(enum_type)
+  GraphQL::Language::Nodes::EnumTypeDefinition.new(
+    name: enum_type.graphql_name,
+    values: warden.enum_values(enum_type).sort_by(&:graphql_name).map do |enum_value|
+      build_enum_value_node(enum_value)
+    end,
+    description: enum_type.description,
+    directives: directives(enum_type),
+  )
+end
+
+
+ +
+

+ + #build_enum_value_node(enum_value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+115
+116
+117
+118
+119
+120
+121
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 115
+
+def build_enum_value_node(enum_value)
+  GraphQL::Language::Nodes::EnumValueDefinition.new(
+    name: enum_value.graphql_name,
+    description: enum_value.description,
+    directives: directives(enum_value),
+  )
+end
+
+
+ +
+

+ + #build_field_node(field) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+75
+76
+77
+78
+79
+80
+81
+82
+83
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 75
+
+def build_field_node(field)
+  GraphQL::Language::Nodes::FieldDefinition.new(
+    name: field.graphql_name,
+    arguments: build_argument_nodes(warden.arguments(field)),
+    type: build_type_name_node(field.type),
+    description: field.description,
+    directives: directives(field),
+  )
+end
+
+
+ +
+

+ + #build_field_nodes(fields) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+298
+299
+300
+301
+302
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 298
+
+def build_field_nodes(fields)
+  f_nodes = fields.map { |field| build_field_node(field) }
+  f_nodes.sort_by!(&:name)
+  f_nodes
+end
+
+
+ +
+

+ + #build_input_object_node(input_object) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+149
+150
+151
+152
+153
+154
+155
+156
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 149
+
+def build_input_object_node(input_object)
+  GraphQL::Language::Nodes::InputObjectTypeDefinition.new(
+    name: input_object.graphql_name,
+    fields: build_argument_nodes(warden.arguments(input_object)),
+    description: input_object.description,
+    directives: directives(input_object),
+  )
+end
+
+
+ +
+

+ + #build_interface_type_node(interface_type) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+94
+95
+96
+97
+98
+99
+100
+101
+102
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 94
+
+def build_interface_type_node(interface_type)
+  GraphQL::Language::Nodes::InterfaceTypeDefinition.new(
+    name: interface_type.graphql_name,
+    interfaces: warden.interfaces(interface_type).sort_by(&:graphql_name).map { |type| build_type_name_node(type) },
+    description: interface_type.description,
+    fields: build_field_nodes(warden.fields(interface_type)),
+    directives: directives(interface_type),
+  )
+end
+
+
+ +
+

+ + #build_object_type_node(object_type) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 59
+
+def build_object_type_node(object_type)
+  ints = warden.interfaces(object_type)
+  if ints.any?
+    ints.sort_by!(&:graphql_name)
+    ints.map! { |iface| build_type_name_node(iface) }
+  end
+
+  GraphQL::Language::Nodes::ObjectTypeDefinition.new(
+    name: object_type.graphql_name,
+    interfaces: ints,
+    fields: build_field_nodes(warden.fields(object_type)),
+    description: object_type.description,
+    directives: directives(object_type),
+  )
+end
+
+
+ +
+

+ + #build_scalar_type_node(scalar_type) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+123
+124
+125
+126
+127
+128
+129
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 123
+
+def build_scalar_type_node(scalar_type)
+  GraphQL::Language::Nodes::ScalarTypeDefinition.new(
+    name: scalar_type.graphql_name,
+    description: scalar_type.description,
+    directives: directives(scalar_type),
+  )
+end
+
+
+ +
+

+ + #build_schema_nodeObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 44
+
+def build_schema_node
+  if !schema_respects_root_name_conventions?(@schema)
+    GraphQL::Language::Nodes::SchemaDefinition.new(
+      query: (q = warden.root_type_for_operation("query")) && q.graphql_name,
+      mutation: (m = warden.root_type_for_operation("mutation")) && m.graphql_name,
+      subscription: (s = warden.root_type_for_operation("subscription")) && s.graphql_name,
+      directives: definition_directives(@schema, :schema_directives)
+    )
+  else
+    # A plain `schema ...` _must_ include root type definitions.
+    # If the only difference is directives, then you have to use `extend schema`
+    GraphQL::Language::Nodes::SchemaExtension.new(directives: definition_directives(@schema, :schema_directives))
+  end
+end
+
+
+ +
+

+ + #build_type_definition_node(type) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 227
+
+def build_type_definition_node(type)
+  case type.kind.name
+  when "OBJECT"
+    build_object_type_node(type)
+  when "UNION"
+    build_union_type_node(type)
+  when "INTERFACE"
+    build_interface_type_node(type)
+  when "SCALAR"
+    build_scalar_type_node(type)
+  when "ENUM"
+    build_enum_type_node(type)
+  when "INPUT_OBJECT"
+    build_input_object_node(type)
+  else
+    raise TypeError
+  end
+end
+
+
+ +
+

+ + #build_type_definition_nodes(types) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 284
+
+def build_type_definition_nodes(types)
+  if !include_introspection_types
+    types = types.reject { |type| type.introspection? }
+  end
+
+  if !include_built_in_scalars
+    types = types.reject { |type| type.kind.scalar? && type.default_scalar? }
+  end
+
+  types
+    .map { |type| build_type_definition_node(type) }
+    .sort_by(&:name)
+end
+
+
+ +
+

+ + #build_type_name_node(type) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 178
+
+def build_type_name_node(type)
+  case type.kind.name
+  when "LIST"
+    GraphQL::Language::Nodes::ListType.new(
+      of_type: build_type_name_node(type.of_type)
+    )
+  when "NON_NULL"
+    GraphQL::Language::Nodes::NonNullType.new(
+      of_type: build_type_name_node(type.of_type)
+    )
+  else
+    @cached_type_name_nodes ||= {}
+    @cached_type_name_nodes[type.graphql_name] ||= GraphQL::Language::Nodes::TypeName.new(name: type.graphql_name)
+  end
+end
+
+
+ +
+

+ + #build_union_type_node(union_type) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+91
+92
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 85
+
+def build_union_type_node(union_type)
+  GraphQL::Language::Nodes::UnionTypeDefinition.new(
+    name: union_type.graphql_name,
+    description: union_type.description,
+    types: warden.possible_types(union_type).sort_by(&:graphql_name).map { |type| build_type_name_node(type) },
+    directives: directives(union_type),
+  )
+end
+
+
+ +
+

+ + #documentObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+38
+39
+40
+41
+42
+
+
# File 'lib/graphql/language/document_from_schema_definition.rb', line 38
+
+def document
+  GraphQL::Language::Nodes::Document.new(
+    definitions: build_definition_nodes
+  )
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Generation.html b/api-doc/2.1.6/GraphQL/Language/Generation.html new file mode 100644 index 0000000000..fa8efb09db --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Generation.html @@ -0,0 +1,288 @@ + + + + + + + Module: GraphQL::Language::Generation + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Language::Generation + + + +

+
+ + + + +
+
Extended by:
+
Generation
+
+ + + + + + +
+
Included in:
+
Generation
+
+ + + +
+
Defined in:
+
lib/graphql/language/generation.rb
+
+ +
+ +

Overview

+
+

Exposes #generate, which turns AST nodes back into query strings.

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #generate(node, indent: "", printer: GraphQL::Language::Printer.new) ⇒ String + + + + + +

+
+

Turn an AST node back into a string.

+ + +
+
+
+ +
+

Examples:

+ + +

Turning a document into a query

+

+ +
document = GraphQL.parse(query_string)
+GraphQL::Language::Generation.generate(document)
+# => "{ ... }"
+ +
+

Parameters:

+
    + +
  • + + node + + + (GraphQL::Language::Nodes::AbstractNode) + + + + — +

    an AST node to recursively stringify

    +
    + +
  • + +
  • + + indent + + + (String) + + + (defaults to: "") + + + — +

    Whitespace to add to each printed node

    +
    + +
  • + +
  • + + printer + + + (GraphQL::Language::Printer) + + + (defaults to: GraphQL::Language::Printer.new) + + + — +

    An optional custom printer for printing AST nodes. Defaults to GraphQL::Language::Printer

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    Valid GraphQL for node

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/language/generation.rb', line 19
+
+def generate(node, indent: "", printer: GraphQL::Language::Printer.new)
+  printer.print(node, indent: indent)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Lexer.html b/api-doc/2.1.6/GraphQL/Language/Lexer.html new file mode 100644 index 0000000000..6c4b97a5a9 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Lexer.html @@ -0,0 +1,1013 @@ + + + + + + + Class: GraphQL::Language::Lexer + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Lexer + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Literals
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/lexer.rb
+
+ +
+ +
+

Direct Known Subclasses

+

BadEncoding

+
+

Defined Under Namespace

+

+ + + Modules: Literals + + + + Classes: BadEncoding + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
IDENTIFIER = + +
+
/[_A-Za-z][_0-9A-Za-z]*/
+ +
NEWLINE = + +
+
/[\c\r\n]/
+ +
BLANK = + +
+
/[, \t]+/
+ +
COMMENT = + +
+
/#[^\n\r]*/
+ +
INT = + +
+
/[-]?(?:[0]|[1-9][0-9]*)/
+ +
FLOAT_DECIMAL = + +
+
/[.][0-9]+/
+ +
FLOAT_EXP = + +
+
/[eE][+-]?[0-9]+/
+ +
FLOAT = + +
+
/#{INT}(#{FLOAT_DECIMAL}#{FLOAT_EXP}|#{FLOAT_DECIMAL}|#{FLOAT_EXP})/
+ +
QUOTE = + +
+
'"'
+ +
UNICODE_DIGIT = + +
+
/[0-9A-Za-z]/
+ +
FOUR_DIGIT_UNICODE = + +
+
/#{UNICODE_DIGIT}{4}/
+ +
N_DIGIT_UNICODE = + +
+
%r{#{LCURLY}#{UNICODE_DIGIT}{4,}#{RCURLY}}x
+ +
UNICODE_ESCAPE = + +
+
%r{\\u(?:#{FOUR_DIGIT_UNICODE}|#{N_DIGIT_UNICODE})}
+ +
STRING_ESCAPE = +
+
+

https://graphql.github.io/graphql-spec/June2018/#sec-String-Value

+ + +
+
+
+ + +
+
+
%r{[\\][\\/bfnrt]}
+ +
BLOCK_QUOTE = + +
+
'"""'
+ +
ESCAPED_QUOTE = + +
+
/\\"/
+ +
STRING_CHAR = + +
+
/#{ESCAPED_QUOTE}|[^"\\]|#{UNICODE_ESCAPE}|#{STRING_ESCAPE}/
+ +
LIT_NAME_LUT = + +
+
Literals.constants.each_with_object({}) { |n, o|
+  key = Literals.const_get(n)
+  key = key.is_a?(Regexp) ? key.source.gsub(/(\\b|\\)/, '') : key
+  o[key] = n
+}
+ +
LIT = + +
+
Regexp.union(Literals.constants.map { |n| Literals.const_get(n) })
+ +
QUOTED_STRING = + +
+
%r{#{QUOTE} (?:#{STRING_CHAR})* #{QUOTE}}x
+ +
BLOCK_STRING = + +
+
%r{
+  #{BLOCK_QUOTE}
+  (?: [^"\\]               |  # Any characters that aren't a quote or slash
+     (?<!") ["]{1,2} (?!") |  # Any quotes that don't have quotes next to them
+     \\"{0,3}(?!")         |  # A slash followed by <= 3 quotes that aren't followed by a quote
+     \\                    |  # A slash
+     "{1,2}(?!")              # 1 or 2 " followed by something that isn't a quote
+  )*
+  (?:"")?
+  #{BLOCK_QUOTE}
+}xm
+ +
UNKNOWN_CHAR = +
+
+

catch-all for anything else. must be at the bottom for precedence.

+ + +
+
+
+ + +
+
+
/./
+ +
ESCAPES = + +
+
/\\["\\\/bfnrt]/
+ +
ESCAPES_REPLACE = + +
+
{
+  '\\"' => '"',
+  "\\\\" => "\\",
+  "\\/" => '/',
+  "\\b" => "\b",
+  "\\f" => "\f",
+  "\\n" => "\n",
+  "\\r" => "\r",
+  "\\t" => "\t",
+}
+ +
UTF_8 = + +
+
/\\u(?:([\dAa-f]{4})|\{([\da-f]{4,})\})(?:\\u([\dAa-f]{4}))?/i
+ +
VALID_STRING = + +
+
/\A(?:[^\\]|#{ESCAPES}|#{UTF_8})*\z/o
+ +
+ + + + + + +

Constants included + from Literals

+

Literals::AMP, Literals::BANG, Literals::COLON, Literals::DIRECTIVE, Literals::DIR_SIGN, Literals::ELLIPSIS, Literals::ENUM, Literals::EQUALS, Literals::EXTEND, Literals::FALSE, Literals::FRAGMENT, Literals::IMPLEMENTS, Literals::INPUT, Literals::INTERFACE, Literals::LBRACKET, Literals::LCURLY, Literals::LPAREN, Literals::MUTATION, Literals::NULL, Literals::ON, Literals::PIPE, Literals::QUERY, Literals::RBRACKET, Literals::RCURLY, Literals::REPEATABLE, Literals::RPAREN, Literals::SCALAR, Literals::SCHEMA, Literals::SUBSCRIPTION, Literals::TRUE, Literals::TYPE, Literals::UNION, Literals::VAR_SIGN

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(value) ⇒ Lexer + + + + + +

+
+

Returns a new instance of Lexer.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+90
+91
+92
+93
+94
+95
+96
+
+
# File 'lib/graphql/language/lexer.rb', line 90
+
+def initialize(value)
+  @line = 1
+  @col = 1
+  @previous_token = nil
+
+  @scan = scanner value
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .replace_escaped_characters_in_place(raw_string) ⇒ Object + + + + + +

+
+

Replace any escaped unicode or whitespace with the actual characters +To avoid allocating more strings, this modifies the string passed into it

+ + +
+
+
+ + +
+ + + + +
+
+
+
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+
# File 'lib/graphql/language/lexer.rb', line 169
+
+def self.replace_escaped_characters_in_place(raw_string)
+  raw_string.gsub!(ESCAPES, ESCAPES_REPLACE)
+  raw_string.gsub!(UTF_8) do |_matched_str|
+    codepoint_1 = ($1 || $2).to_i(16)
+    codepoint_2 = $3
+
+    if codepoint_2
+      codepoint_2 = codepoint_2.to_i(16)
+      if (codepoint_1 >= 0xD800 && codepoint_1 <= 0xDBFF) && # leading surrogate
+          (codepoint_2 >= 0xDC00 && codepoint_2 <= 0xDFFF) # trailing surrogate
+        # A surrogate pair
+        combined = ((codepoint_1 - 0xD800) * 0x400) + (codepoint_2 - 0xDC00) + 0x10000
+        [combined].pack('U'.freeze)
+      else
+        # Two separate code points
+        [codepoint_1].pack('U'.freeze) + [codepoint_2].pack('U'.freeze)
+      end
+    else
+      [codepoint_1].pack('U'.freeze)
+    end
+  end
+  nil
+end
+
+
+ +
+

+ + .tokenize(string) ⇒ Object + + + + + +

+ + + + +
+
+
+
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+
+
# File 'lib/graphql/language/lexer.rb', line 108
+
+def self.tokenize(string)
+  value = string.dup.force_encoding(Encoding::UTF_8)
+
+  scanner = if value.valid_encoding?
+    new value
+  else
+    BadEncoding.new value
+  end
+
+  toks = []
+
+  while tok = scanner.next_token
+    toks << tok
+  end
+
+  toks
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #emit(token_name, ts, te, token_value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+
+
# File 'lib/graphql/language/lexer.rb', line 153
+
+def emit(token_name, ts, te, token_value)
+  token = [
+    token_name,
+    @line,
+    @col,
+    token_value,
+    @previous_token,
+  ]
+  @previous_token = token
+  # Bump the column counter for the next token
+  @col += te - ts
+  token
+end
+
+
+ +
+

+ + #emit_block(ts, te, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+222
+223
+224
+225
+226
+227
+228
+
+
# File 'lib/graphql/language/lexer.rb', line 222
+
+def emit_block(ts, te, value)
+  line_incr = value.count("\n")
+  value = GraphQL::Language::BlockString.trim_whitespace(value)
+  tok = emit_string(ts, te, value)
+  @line += line_incr
+  tok
+end
+
+
+ +
+

+ + #emit_string(ts, te, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+
+
# File 'lib/graphql/language/lexer.rb', line 230
+
+def emit_string(ts, te, value)
+  if !value.valid_encoding? || !value.match?(VALID_STRING)
+    emit(:BAD_UNICODE_ESCAPE, ts, te, value)
+  else
+    self.class.replace_escaped_characters_in_place(value)
+
+    if !value.valid_encoding?
+      emit(:BAD_UNICODE_ESCAPE, ts, te, value)
+    else
+      emit(:STRING, ts, te, value)
+    end
+  end
+end
+
+
+ +
+

+ + #next_tokenObject + + + + + +

+ + + + +
+
+
+
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+
+
# File 'lib/graphql/language/lexer.rb', line 126
+
+def next_token
+  return if @scan.eos?
+
+  pos = @scan.pos
+
+  case
+  when str = @scan.scan(FLOAT)         then emit(:FLOAT, pos, @scan.pos, str)
+  when str = @scan.scan(INT)           then emit(:INT, pos, @scan.pos, str)
+  when str = @scan.scan(LIT)           then emit(LIT_NAME_LUT[str], pos, @scan.pos, -str)
+  when str = @scan.scan(IDENTIFIER)    then emit(:IDENTIFIER, pos, @scan.pos, str)
+  when str = @scan.scan(BLOCK_STRING)  then emit_block(pos, @scan.pos, str.gsub(/\A#{BLOCK_QUOTE}|#{BLOCK_QUOTE}\z/, ''))
+  when str = @scan.scan(QUOTED_STRING) then emit_string(pos, @scan.pos, str.gsub(/^"|"$/, ''))
+  when str = @scan.scan(COMMENT)       then record_comment(pos, @scan.pos, str)
+  when str = @scan.scan(NEWLINE)
+    @line += 1
+    @col = 1
+    next_token
+  when @scan.scan(BLANK)
+    @col += @scan.pos - pos
+    next_token
+  when str = @scan.scan(UNKNOWN_CHAR) then emit(:UNKNOWN_CHAR, pos, @scan.pos, str)
+  else
+    # This should never happen since `UNKNOWN_CHAR` ensures we make progress
+    raise "Unknown string?"
+  end
+end
+
+
+ +
+

+ + #record_comment(ts, te, str) ⇒ Object + + + + + +

+ + + + +
+
+
+
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+
+
# File 'lib/graphql/language/lexer.rb', line 193
+
+def record_comment(ts, te, str)
+  token = [
+    :COMMENT,
+    @line,
+    @col,
+    str,
+    @previous_token,
+  ]
+
+  @previous_token = token
+
+  @col += te - ts
+  next_token
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Lexer/BadEncoding.html b/api-doc/2.1.6/GraphQL/Language/Lexer/BadEncoding.html new file mode 100644 index 0000000000..118ee64e5d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Lexer/BadEncoding.html @@ -0,0 +1,291 @@ + + + + + + + Class: GraphQL::Language::Lexer::BadEncoding + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Lexer::BadEncoding + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Language::Lexer + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/lexer.rb
+
+ +
+ +

Overview

+
+

:nodoc:

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from GraphQL::Language::Lexer

+

BLANK, BLOCK_QUOTE, BLOCK_STRING, COMMENT, ESCAPED_QUOTE, ESCAPES, ESCAPES_REPLACE, FLOAT, FLOAT_DECIMAL, FLOAT_EXP, FOUR_DIGIT_UNICODE, IDENTIFIER, INT, LIT, LIT_NAME_LUT, NEWLINE, N_DIGIT_UNICODE, QUOTE, QUOTED_STRING, STRING_CHAR, STRING_ESCAPE, UNICODE_DIGIT, UNICODE_ESCAPE, UNKNOWN_CHAR, UTF_8, VALID_STRING

+ + + +

Constants included + from Literals

+

Literals::AMP, Literals::BANG, Literals::COLON, Literals::DIRECTIVE, Literals::DIR_SIGN, Literals::ELLIPSIS, Literals::ENUM, Literals::EQUALS, Literals::EXTEND, Literals::FALSE, Literals::FRAGMENT, Literals::IMPLEMENTS, Literals::INPUT, Literals::INTERFACE, Literals::LBRACKET, Literals::LCURLY, Literals::LPAREN, Literals::MUTATION, Literals::NULL, Literals::ON, Literals::PIPE, Literals::QUERY, Literals::RBRACKET, Literals::RCURLY, Literals::REPEATABLE, Literals::RPAREN, Literals::SCALAR, Literals::SCHEMA, Literals::SUBSCRIPTION, Literals::TRUE, Literals::TYPE, Literals::UNION, Literals::VAR_SIGN

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Language::Lexer

+

#emit, #emit_block, #emit_string, #initialize, #record_comment, replace_escaped_characters_in_place, tokenize

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Lexer

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #next_tokenObject + + + + + +

+ + + + +
+
+
+
+103
+104
+105
+
+
# File 'lib/graphql/language/lexer.rb', line 103
+
+def next_token
+  @scan.pop
+end
+
+
+ +
+

+ + #scanner(value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+99
+100
+101
+
+
# File 'lib/graphql/language/lexer.rb', line 99
+
+def scanner(value)
+  [emit(:BAD_UNICODE_ESCAPE, 0, 0, value)]
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Lexer/Literals.html b/api-doc/2.1.6/GraphQL/Language/Lexer/Literals.html new file mode 100644 index 0000000000..5ea1c01a4a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Lexer/Literals.html @@ -0,0 +1,286 @@ + + + + + + + Module: GraphQL::Language::Lexer::Literals + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Language::Lexer::Literals + + + +

+
+ + + + + + + + + +
+
Included in:
+
GraphQL::Language::Lexer
+
+ + + +
+
Defined in:
+
lib/graphql/language/lexer.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
ON = + +
+
/on\b/
+ +
FRAGMENT = + +
+
/fragment\b/
+ +
TRUE = + +
+
/true\b/
+ +
FALSE = + +
+
/false\b/
+ +
NULL = + +
+
/null\b/
+ +
QUERY = + +
+
/query\b/
+ +
MUTATION = + +
+
/mutation\b/
+ +
SUBSCRIPTION = + +
+
/subscription\b/
+ +
SCHEMA = + +
+
/schema\b/
+ +
SCALAR = + +
+
/scalar\b/
+ +
TYPE = + +
+
/type\b/
+ +
EXTEND = + +
+
/extend\b/
+ +
IMPLEMENTS = + +
+
/implements\b/
+ +
INTERFACE = + +
+
/interface\b/
+ +
UNION = + +
+
/union\b/
+ +
ENUM = + +
+
/enum\b/
+ +
INPUT = + +
+
/input\b/
+ +
DIRECTIVE = + +
+
/directive\b/
+ +
REPEATABLE = + +
+
/repeatable\b/
+ +
LCURLY = + +
+
'{'
+ +
RCURLY = + +
+
'}'
+ +
LPAREN = + +
+
'('
+ +
RPAREN = + +
+
')'
+ +
LBRACKET = + +
+
'['
+ +
RBRACKET = + +
+
']'
+ +
COLON = + +
+
':'
+ +
VAR_SIGN = + +
+
'$'
+ +
DIR_SIGN = + +
+
'@'
+ +
ELLIPSIS = + +
+
'...'
+ +
EQUALS = + +
+
'='
+ +
BANG = + +
+
'!'
+ +
PIPE = + +
+
'|'
+ +
AMP = + +
+
'&'
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes.html b/api-doc/2.1.6/GraphQL/Language/Nodes.html new file mode 100644 index 0000000000..8240b5a6dc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes.html @@ -0,0 +1,303 @@ + + + + + + + Module: GraphQL::Language::Nodes + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Language::Nodes + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: AbstractNode, Argument, Directive, DirectiveDefinition, DirectiveLocation, Document, Enum, EnumTypeDefinition, EnumTypeExtension, EnumValueDefinition, Field, FieldDefinition, FragmentDefinition, FragmentSpread, InlineFragment, InputObject, InputObjectTypeDefinition, InputObjectTypeExtension, InputValueDefinition, InterfaceTypeDefinition, InterfaceTypeExtension, ListType, NameOnlyNode, NonNullType, NullValue, ObjectTypeDefinition, ObjectTypeExtension, OperationDefinition, ScalarTypeDefinition, ScalarTypeExtension, SchemaDefinition, SchemaExtension, TypeName, UnionTypeDefinition, UnionTypeExtension, VariableDefinition, VariableIdentifier, WrapperType + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
NONE = + +
+
GraphQL::EmptyObjects::EMPTY_ARRAY
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #name ⇒ String + + + + + + + + + + + + + + + + +

    The identifier of the fragment to apply, corresponds with FragmentDefinition#name.

    +
    + +
  • + + +
  • + + + #type ⇒ String? + + + + + + + + + + + + + + + + +

    Name of the type this fragment applies to, or nil if this fragment applies to any type.

    +
    + +
  • + + +
+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #nameString + + + + + +

+
+

Returns The identifier of the fragment to apply, corresponds with GraphQL::Language::Nodes::FragmentDefinition#name.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+
+
+
# File 'lib/graphql/language/nodes.rb', line 419
+
+
+
+
+ + + +
+

+ + #typeString? + + + + + +

+
+

Returns Name of the type this fragment applies to, or nil if this fragment applies to any type.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + + — +

    Name of the type this fragment applies to, or nil if this fragment applies to any type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+
+
+
# File 'lib/graphql/language/nodes.rb', line 433
+
+
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/AbstractNode.html b/api-doc/2.1.6/GraphQL/Language/Nodes/AbstractNode.html new file mode 100644 index 0000000000..c8fd53e662 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/AbstractNode.html @@ -0,0 +1,1436 @@ + + + + + + + Class: GraphQL::Language::Nodes::AbstractNode + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::AbstractNode + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

AbstractNode is the base class for all nodes in a GraphQL AST.

+ +

It provides some APIs for working with ASTs: +- children returns all AST nodes attached to this one. Used for tree traversal. +- scalars returns all scalar (Ruby) values attached to this one. Used for comparing nodes. +- to_query_string turns an AST node into a GraphQL string

+ + +
+
+
+ + +
+

Defined Under Namespace

+

+ + + Modules: DefinitionNode + + + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
NO_CHILDREN = + +
+
GraphQL::EmptyObjects::EMPTY_ARRAY
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #col ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute col.

    +
    + +
  • + + +
  • + + + #filename ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute filename.

    +
    + +
  • + + +
  • + + + #line ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute line.

    +
    + +
  • + + +
+ + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(options = {}) ⇒ AbstractNode + + + + + +

+
+

Initialize a node by extracting its position, +then calling the class’s initialize_node method.

+ + +
+
+
+

Parameters:

+
    + +
  • + + options + + + (Hash) + + + (defaults to: {}) + + + — +

    Initial attributes for this node

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
+
# File 'lib/graphql/language/nodes.rb', line 30
+
+def initialize(options = {})
+  if options.key?(:position_source)
+    position_source = options.delete(:position_source)
+    @line = position_source[1]
+    @col = position_source[2]
+  else
+    @line = options.delete(:line)
+    @col = options.delete(:col)
+  end
+
+  @filename = options.delete(:filename)
+
+  initialize_node(**options)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #colObject (readonly) + + + + + +

+
+

Returns the value of attribute col.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'lib/graphql/language/nodes.rb', line 25
+
+def col
+  @col
+end
+
+
+ + + +
+

+ + #filenameObject (readonly) + + + + + +

+
+

Returns the value of attribute filename.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'lib/graphql/language/nodes.rb', line 25
+
+def filename
+  @filename
+end
+
+
+ + + +
+

+ + #lineObject (readonly) + + + + + +

+
+

Returns the value of attribute line.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'lib/graphql/language/nodes.rb', line 25
+
+def line
+  @line
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .children_of_typeObject + + + + + +

+ + + + +
+
+
+
+165
+166
+167
+
+
# File 'lib/graphql/language/nodes.rb', line 165
+
+def children_of_type
+  @children_methods
+end
+
+
+ +
+

+ + .inherited(child_class) ⇒ Object + + + + + +

+
+

Add a default #visit_method and #children_method_name using the class name

+ + +
+
+
+ + +
+ + + + +
+
+
+
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+
+
# File 'lib/graphql/language/nodes.rb', line 142
+
+def inherited(child_class)
+  super
+  name_underscored = child_class.name
+    .split("::").last
+    .gsub(/([a-z])([A-Z])/,'\1_\2') # insert underscores
+    .downcase # remove caps
+
+  child_class.module_eval <<-RUBY, __FILE__, __LINE__
+    def visit_method
+      :on_#{name_underscored}
+    end
+
+    class << self
+      attr_accessor :children_method_name
+
+      def visit_method
+        :on_#{name_underscored}
+      end
+    end
+    self.children_method_name = :#{name_underscored}s
+  RUBY
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #==(other) ⇒ Boolean + + + + + +

+
+

Value equality

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if self is equivalent to other

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+47
+48
+49
+50
+51
+52
+
+
# File 'lib/graphql/language/nodes.rb', line 47
+
+def ==(other)
+  return true if equal?(other)
+  other.kind_of?(self.class) &&
+    other.scalars == self.scalars &&
+    other.children == self.children
+end
+
+
+ +
+

+ + #childrenArray<GraphQL::Language::Nodes::AbstractNode> + + + + + +

+
+

Returns all nodes in the tree below this one.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/graphql/language/nodes.rb', line 57
+
+def children
+  NO_CHILDREN
+end
+
+
+ +
+

+ + #children_method_nameObject + + + + + +

+ + + + +
+
+
+
+73
+74
+75
+
+
# File 'lib/graphql/language/nodes.rb', line 73
+
+def children_method_name
+  self.class.children_method_name
+end
+
+
+ +
+

+ + #delete_child(previous_child) ⇒ Object + + + + + +

+
+

TODO DRY with replace_child

+ + +
+
+
+ + +
+ + + + +
+
+
+
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+
+
# File 'lib/graphql/language/nodes.rb', line 119
+
+def delete_child(previous_child)
+  # Figure out which list `previous_child` may be found in
+  method_name = previous_child.children_method_name
+  # Copy that list, and delete previous_child
+  new_children = public_send(method_name).dup
+  new_children.delete(previous_child)
+  # Copy this node, but with the new list of children:
+  copy_of_self = merge(method_name => new_children)
+  # Return the copy:
+  copy_of_self
+end
+
+
+ +
+

+ + #initialize_copy(other) ⇒ Object + + + + + +

+
+

This might be unnecessary, but its easiest to add it here.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+67
+68
+69
+70
+71
+
+
# File 'lib/graphql/language/nodes.rb', line 67
+
+def initialize_copy(other)
+  @children = nil
+  @scalars = nil
+  @query_string = nil
+end
+
+
+ +
+

+ + #merge(new_options) ⇒ AbstractNode + + + + + +

+
+

This creates a copy of self, with new_options applied.

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_options + + + (Hash) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (AbstractNode) + + + + — +

    a shallow copy of self

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+92
+93
+94
+
+
# File 'lib/graphql/language/nodes.rb', line 92
+
+def merge(new_options)
+  dup.merge!(new_options)
+end
+
+
+ +
+

+ + #positionObject + + + + + +

+ + + + +
+
+
+
+77
+78
+79
+
+
# File 'lib/graphql/language/nodes.rb', line 77
+
+def position
+  [line, col]
+end
+
+
+ +
+

+ + #replace_child(previous_child, new_child) ⇒ Object + + + + + +

+
+

Copy self, but modify the copy so that previous_child is replaced by new_child

+ + +
+
+
+ + +
+ + + + +
+
+
+
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+
+
# File 'lib/graphql/language/nodes.rb', line 97
+
+def replace_child(previous_child, new_child)
+  # Figure out which list `previous_child` may be found in
+  method_name = previous_child.children_method_name
+  # Get the value from this (original) node
+  prev_children = public_send(method_name)
+  if prev_children.is_a?(Array)
+    # Copy that list, and replace `previous_child` with `new_child`
+    # in the list.
+    new_children = prev_children.dup
+    prev_idx = new_children.index(previous_child)
+    new_children[prev_idx] = new_child
+  else
+    # Use the new value for the given attribute
+    new_children = new_child
+  end
+  # Copy this node, but with the new child value
+  copy_of_self = merge(method_name => new_children)
+  # Return the copy:
+  copy_of_self
+end
+
+
+ +
+

+ + #scalarsArray<Integer, Float, String, Boolean, Array> + + + + + +

+
+

Returns Scalar values attached to this node.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Integer, Float, String, Boolean, Array>) + + + + — +

    Scalar values attached to this node

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+62
+63
+64
+
+
# File 'lib/graphql/language/nodes.rb', line 62
+
+def scalars
+  NO_CHILDREN
+end
+
+
+ +
+

+ + #to_query_string(printer: GraphQL::Language::Printer.new) ⇒ Object + + + + + +

+ + + + +
+
+
+
+81
+82
+83
+84
+85
+86
+87
+
+
# File 'lib/graphql/language/nodes.rb', line 81
+
+def to_query_string(printer: GraphQL::Language::Printer.new)
+  if printer.is_a?(GraphQL::Language::Printer)
+    @query_string ||= printer.print(self)
+  else
+    printer.print(self)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/AbstractNode/DefinitionNode.html b/api-doc/2.1.6/GraphQL/Language/Nodes/AbstractNode/DefinitionNode.html new file mode 100644 index 0000000000..f499904aea --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/AbstractNode/DefinitionNode.html @@ -0,0 +1,274 @@ + + + + + + + Module: GraphQL::Language::Nodes::AbstractNode::DefinitionNode + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Language::Nodes::AbstractNode::DefinitionNode + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #definition_line ⇒ Integer + + + + + + + + + readonly + + + + + + + + + +

    This AST node’s #line returns the first line, which may be the description.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #definition_lineInteger (readonly) + + + + + +

+
+

This AST node’s GraphQL::Language::Nodes::AbstractNode#line returns the first line, which may be the description.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + + — +

    The first line of the definition (not the description)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/language/nodes.rb', line 17
+
+def definition_line
+  @definition_line
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #initialize(options = {}) ⇒ Object + + + + + +

+ + + + +
+
+
+
+19
+20
+21
+22
+
+
# File 'lib/graphql/language/nodes.rb', line 19
+
+def initialize(options = {})
+  @definition_line = options.delete(:definition_line)
+  super(options)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/Argument.html b/api-doc/2.1.6/GraphQL/Language/Nodes/Argument.html new file mode 100644 index 0000000000..3a82542387 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/Argument.html @@ -0,0 +1,407 @@ + + + + + + + Class: GraphQL::Language::Nodes::Argument + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::Argument + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

A key-value pair for a field’s inputs

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

GraphQL::Language::Nodes::AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #name ⇒ String + + + + + + + + + + + + + + + + +

    The key for this argument.

    +
    + +
  • + + +
  • + + + #value ⇒ String, ... + + + + + + + + + + + + + + + + +

    The value passed for this key.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from AbstractNode

+

#==, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nameString + + + + + +

+
+

Returns the key for this argument.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    the key for this argument

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+
+
+
# File 'lib/graphql/language/nodes.rb', line 319
+
+
+
+
+ + + +
+

+ + #valueString, ... + + + + + +

+
+

Returns The value passed for this key.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+325
+326
+327
+
+
# File 'lib/graphql/language/nodes.rb', line 325
+
+def children
+  @children ||= Array(value).flatten.tap { _1.select! { |v| v.is_a?(AbstractNode) } }
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #childrenObject + + + + + +

+ + + + +
+
+
+
+325
+326
+327
+
+
# File 'lib/graphql/language/nodes.rb', line 325
+
+def children
+  @children ||= Array(value).flatten.tap { _1.select! { |v| v.is_a?(AbstractNode) } }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/Directive.html b/api-doc/2.1.6/GraphQL/Language/Nodes/Directive.html new file mode 100644 index 0000000000..f537be4b7d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/Directive.html @@ -0,0 +1,151 @@ + + + + + + + Class: GraphQL::Language::Nodes::Directive + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::Directive + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/DirectiveDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/DirectiveDefinition.html new file mode 100644 index 0000000000..23c64be7c2 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/DirectiveDefinition.html @@ -0,0 +1,237 @@ + + + + + + + Class: GraphQL::Language::Nodes::DirectiveDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::DirectiveDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+340
+341
+342
+
+
# File 'lib/graphql/language/nodes.rb', line 340
+
+def description
+  @description
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/DirectiveLocation.html b/api-doc/2.1.6/GraphQL/Language/Nodes/DirectiveLocation.html new file mode 100644 index 0000000000..31c7dbdbd9 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/DirectiveLocation.html @@ -0,0 +1,159 @@ + + + + + + + Class: GraphQL::Language::Nodes::DirectiveLocation + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::DirectiveLocation + + + +

+
+ +
+
Inherits:
+
+ NameOnlyNode + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/Document.html b/api-doc/2.1.6/GraphQL/Language/Nodes/Document.html new file mode 100644 index 0000000000..776f093d8d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/Document.html @@ -0,0 +1,356 @@ + + + + + + + Class: GraphQL::Language::Nodes::Document + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::Document + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

This is the AST root for normal queries

+ + +
+
+
+ +
+

Examples:

+ + +

Deriving a document by parsing a string

+

+ +
document = GraphQL.parse(query_string)
+ + +

Creating a string from a document

+

+ +
document.to_query_string
+# { ... }
+ + +

Creating a custom string from a document

+

+ +
class VariableScrubber < GraphQL::Language::Printer
+  def print_argument(arg)
+    print_string("#{arg.name}: <HIDDEN>")
+  end
+end
+
+document.to_query_string(printer: VariableScrubber.new)
+ +
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #definitionsArray<OperationDefinition, FragmentDefinition> + + + + + +

+
+

Returns top-level GraphQL units: operations or fragments.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+550
+551
+552
+
+
# File 'lib/graphql/language/nodes.rb', line 550
+
+def slice_definition(name)
+  GraphQL::Language::DefinitionSlice.slice(self, name)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #slice_definition(name) ⇒ Object + + + + + +

+ + + + +
+
+
+
+550
+551
+552
+
+
# File 'lib/graphql/language/nodes.rb', line 550
+
+def slice_definition(name)
+  GraphQL::Language::DefinitionSlice.slice(self, name)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/Enum.html b/api-doc/2.1.6/GraphQL/Language/Nodes/Enum.html new file mode 100644 index 0000000000..22aab9a073 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/Enum.html @@ -0,0 +1,169 @@ + + + + + + + Class: GraphQL::Language::Nodes::Enum + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::Enum + + + +

+
+ +
+
Inherits:
+
+ NameOnlyNode + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

An enum value. The string is available as #name.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/EnumTypeDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/EnumTypeDefinition.html new file mode 100644 index 0000000000..dd0e7e4d9f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/EnumTypeDefinition.html @@ -0,0 +1,237 @@ + + + + + + + Class: GraphQL::Language::Nodes::EnumTypeDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::EnumTypeDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+703
+704
+705
+
+
# File 'lib/graphql/language/nodes.rb', line 703
+
+def description
+  @description
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/EnumTypeExtension.html b/api-doc/2.1.6/GraphQL/Language/Nodes/EnumTypeExtension.html new file mode 100644 index 0000000000..40ac1670a0 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/EnumTypeExtension.html @@ -0,0 +1,151 @@ + + + + + + + Class: GraphQL::Language::Nodes::EnumTypeExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::EnumTypeExtension + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/EnumValueDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/EnumValueDefinition.html new file mode 100644 index 0000000000..6d7cccaf86 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/EnumValueDefinition.html @@ -0,0 +1,237 @@ + + + + + + + Class: GraphQL::Language::Nodes::EnumValueDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::EnumValueDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+693
+694
+695
+
+
# File 'lib/graphql/language/nodes.rb', line 693
+
+def description
+  @description
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/Field.html b/api-doc/2.1.6/GraphQL/Language/Nodes/Field.html new file mode 100644 index 0000000000..680657e285 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/Field.html @@ -0,0 +1,424 @@ + + + + + + + Class: GraphQL::Language::Nodes::Field + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::Field + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

A single selection in a GraphQL query.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #selectionsArray<Nodes::Field> + + + + + +

+
+

Returns Selections on this object (or empty array if this is a scalar field).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Nodes::Field>) + + + + — +

    Selections on this object (or empty array if this is a scalar field)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+368
+369
+370
+371
+372
+373
+374
+375
+
+
# File 'lib/graphql/language/nodes.rb', line 368
+
+def initialize_node(attributes)
+  @name = attributes[:name]
+  @arguments = attributes[:arguments] || NONE
+  @directives = attributes[:directives] || NONE
+  @selections = attributes[:selections] || NONE
+  # oops, alias is a keyword:
+  @alias = attributes[:alias]
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .from_a(filename, line, col, graphql_alias, name, arguments, directives, selections) ⇒ Object + + + + + +

+
+

rubocop:disable Metrics/ParameterLists

+ + +
+
+
+ + +
+ + + + +
+
+
+
+377
+378
+379
+
+
# File 'lib/graphql/language/nodes.rb', line 377
+
+def self.from_a(filename, line, col, graphql_alias, name, arguments, directives, selections) # rubocop:disable Metrics/ParameterLists
+  self.new(filename: filename, line: line, col: col, alias: graphql_alias, name: name, arguments: arguments, directives: directives, selections: selections)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #initialize_node(attributes) ⇒ Object + + + + + +

+ + + + +
+
+
+
+368
+369
+370
+371
+372
+373
+374
+375
+
+
# File 'lib/graphql/language/nodes.rb', line 368
+
+def initialize_node(attributes)
+  @name = attributes[:name]
+  @arguments = attributes[:arguments] || NONE
+  @directives = attributes[:directives] || NONE
+  @selections = attributes[:selections] || NONE
+  # oops, alias is a keyword:
+  @alias = attributes[:alias]
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/FieldDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/FieldDefinition.html new file mode 100644 index 0000000000..6a7f894dcc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/FieldDefinition.html @@ -0,0 +1,313 @@ + + + + + + + Class: GraphQL::Language::Nodes::FieldDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::FieldDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+611
+612
+613
+
+
# File 'lib/graphql/language/nodes.rb', line 611
+
+def description
+  @description
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #merge(new_options) ⇒ Object + + + + + +

+ + + + +
+
+
+
+622
+623
+624
+625
+626
+627
+
+
# File 'lib/graphql/language/nodes.rb', line 622
+
+def merge(new_options)
+  if (f = new_options.delete(:fields))
+    new_options[:arguments] = f
+  end
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/FragmentDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/FragmentDefinition.html new file mode 100644 index 0000000000..0b6d5592ab --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/FragmentDefinition.html @@ -0,0 +1,487 @@ + + + + + + + Class: GraphQL::Language::Nodes::FragmentDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::FragmentDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

A reusable fragment, defined at document-level.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #name ⇒ String + + + + + + + + + + + + + + + + +

    The identifier for this fragment, which may be applied with ...#{name}.

    +
    + +
  • + + +
  • + + + #type ⇒ String + + + + + + + + + + + + + + + + +

    The type condition for this fragment (name of type which it may apply to).

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nameString + + + + + +

+
+

Returns the identifier for this fragment, which may be applied with ...#{name}.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    the identifier for this fragment, which may be applied with ...#{name}

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+
+
+
# File 'lib/graphql/language/nodes.rb', line 387
+
+
+
+
+ + + +
+

+ + #typeString + + + + + +

+
+

Returns the type condition for this fragment (name of type which it may apply to).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    the type condition for this fragment (name of type which it may apply to)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+392
+393
+394
+395
+396
+397
+
+
# File 'lib/graphql/language/nodes.rb', line 392
+
+def initialize_node(name: nil, type: nil, directives: [], selections: [])
+  @name = name
+  @type = type
+  @directives = directives
+  @selections = selections
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .from_a(filename, line, col, name, type, directives, selections) ⇒ Object + + + + + +

+ + + + +
+
+
+
+399
+400
+401
+
+
# File 'lib/graphql/language/nodes.rb', line 399
+
+def self.from_a(filename, line, col, name, type, directives, selections)
+  self.new(filename: filename, line: line, col: col, name: name, type: type, directives: directives, selections: selections)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #initialize_node(name: nil, type: nil, directives: [], selections: []) ⇒ Object + + + + + +

+ + + + +
+
+
+
+392
+393
+394
+395
+396
+397
+
+
# File 'lib/graphql/language/nodes.rb', line 392
+
+def initialize_node(name: nil, type: nil, directives: [], selections: [])
+  @name = name
+  @type = type
+  @directives = directives
+  @selections = selections
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/FragmentSpread.html b/api-doc/2.1.6/GraphQL/Language/Nodes/FragmentSpread.html new file mode 100644 index 0000000000..e3efcf6c61 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/FragmentSpread.html @@ -0,0 +1,161 @@ + + + + + + + Class: GraphQL::Language::Nodes::FragmentSpread + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::FragmentSpread + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

Application of a named fragment in a selection

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/InlineFragment.html b/api-doc/2.1.6/GraphQL/Language/Nodes/InlineFragment.html new file mode 100644 index 0000000000..3d28ed46e8 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/InlineFragment.html @@ -0,0 +1,161 @@ + + + + + + + Class: GraphQL::Language::Nodes::InlineFragment + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::InlineFragment + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

An unnamed fragment, defined directly in the query with ... { }

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/InputObject.html b/api-doc/2.1.6/GraphQL/Language/Nodes/InputObject.html new file mode 100644 index 0000000000..ab9052a8fe --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/InputObject.html @@ -0,0 +1,357 @@ + + + + + + + Class: GraphQL::Language::Nodes::InputObject + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::InputObject + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

A collection of key-value inputs which may be a field argument

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argumentsArray<Nodes::Argument> + + + + + +

+
+

Returns A list of key-value pairs inside this input object.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Nodes::Argument>) + + + + — +

    A list of key-value pairs inside this input object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+
+
+
# File 'lib/graphql/language/nodes.rb', line 442
+
+
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #to_h(options = {}) ⇒ Hash<String, Any> + + + + + +

+
+

Returns Recursively turn this input object into a Ruby Hash.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<String, Any>) + + + + — +

    Recursively turn this input object into a Ruby Hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+446
+447
+448
+449
+450
+451
+452
+
+
# File 'lib/graphql/language/nodes.rb', line 446
+
+def to_h(options={})
+  arguments.inject({}) do |memo, pair|
+    v = pair.value
+    memo[pair.name] = serialize_value_for_hash v
+    memo
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/InputObjectTypeDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/InputObjectTypeDefinition.html new file mode 100644 index 0000000000..a6e2242da9 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/InputObjectTypeDefinition.html @@ -0,0 +1,237 @@ + + + + + + + Class: GraphQL::Language::Nodes::InputObjectTypeDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::InputObjectTypeDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+723
+724
+725
+
+
# File 'lib/graphql/language/nodes.rb', line 723
+
+def description
+  @description
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/InputObjectTypeExtension.html b/api-doc/2.1.6/GraphQL/Language/Nodes/InputObjectTypeExtension.html new file mode 100644 index 0000000000..ee0e069388 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/InputObjectTypeExtension.html @@ -0,0 +1,151 @@ + + + + + + + Class: GraphQL::Language::Nodes::InputObjectTypeExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::InputObjectTypeExtension + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/InputValueDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/InputValueDefinition.html new file mode 100644 index 0000000000..d135e1ce2c --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/InputValueDefinition.html @@ -0,0 +1,237 @@ + + + + + + + Class: GraphQL::Language::Nodes::InputValueDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::InputValueDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+601
+602
+603
+
+
# File 'lib/graphql/language/nodes.rb', line 601
+
+def description
+  @description
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/InterfaceTypeDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/InterfaceTypeDefinition.html new file mode 100644 index 0000000000..12249fdb4a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/InterfaceTypeDefinition.html @@ -0,0 +1,237 @@ + + + + + + + Class: GraphQL::Language::Nodes::InterfaceTypeDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::InterfaceTypeDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+652
+653
+654
+
+
# File 'lib/graphql/language/nodes.rb', line 652
+
+def description
+  @description
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/InterfaceTypeExtension.html b/api-doc/2.1.6/GraphQL/Language/Nodes/InterfaceTypeExtension.html new file mode 100644 index 0000000000..456553d930 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/InterfaceTypeExtension.html @@ -0,0 +1,151 @@ + + + + + + + Class: GraphQL::Language::Nodes::InterfaceTypeExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::InterfaceTypeExtension + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/ListType.html b/api-doc/2.1.6/GraphQL/Language/Nodes/ListType.html new file mode 100644 index 0000000000..354735e9ef --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/ListType.html @@ -0,0 +1,169 @@ + + + + + + + Class: GraphQL::Language::Nodes::ListType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::ListType + + + +

+
+ +
+
Inherits:
+
+ WrapperType + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

A list type definition, denoted with [...] (used for variable type definitions)

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/NameOnlyNode.html b/api-doc/2.1.6/GraphQL/Language/Nodes/NameOnlyNode.html new file mode 100644 index 0000000000..bf80a8d62f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/NameOnlyNode.html @@ -0,0 +1,165 @@ + + + + + + + Class: GraphQL::Language::Nodes::NameOnlyNode + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::NameOnlyNode + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

Base class for nodes whose only value is a name (no child nodes or other scalars)

+ + +
+
+
+ + +
+

Direct Known Subclasses

+

DirectiveLocation, Enum, NullValue, TypeName, VariableIdentifier

+
+ + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/NonNullType.html b/api-doc/2.1.6/GraphQL/Language/Nodes/NonNullType.html new file mode 100644 index 0000000000..601717c589 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/NonNullType.html @@ -0,0 +1,169 @@ + + + + + + + Class: GraphQL::Language::Nodes::NonNullType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::NonNullType + + + +

+
+ +
+
Inherits:
+
+ WrapperType + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

A non-null type definition, denoted with ...! (used for variable type definitions)

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/NullValue.html b/api-doc/2.1.6/GraphQL/Language/Nodes/NullValue.html new file mode 100644 index 0000000000..97503001fa --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/NullValue.html @@ -0,0 +1,169 @@ + + + + + + + Class: GraphQL::Language::Nodes::NullValue + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::NullValue + + + +

+
+ +
+
Inherits:
+
+ NameOnlyNode + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

A null value literal.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/ObjectTypeDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/ObjectTypeDefinition.html new file mode 100644 index 0000000000..1eab664344 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/ObjectTypeDefinition.html @@ -0,0 +1,237 @@ + + + + + + + Class: GraphQL::Language::Nodes::ObjectTypeDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::ObjectTypeDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+632
+633
+634
+
+
# File 'lib/graphql/language/nodes.rb', line 632
+
+def description
+  @description
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/ObjectTypeExtension.html b/api-doc/2.1.6/GraphQL/Language/Nodes/ObjectTypeExtension.html new file mode 100644 index 0000000000..dc39a2df5f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/ObjectTypeExtension.html @@ -0,0 +1,151 @@ + + + + + + + Class: GraphQL::Language::Nodes::ObjectTypeExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::ObjectTypeExtension + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/OperationDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/OperationDefinition.html new file mode 100644 index 0000000000..e1662e692d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/OperationDefinition.html @@ -0,0 +1,416 @@ + + + + + + + Class: GraphQL::Language::Nodes::OperationDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::OperationDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

A query, mutation or subscription. +May be anonymous or named. +May be explicitly typed (eg mutation { ... }) or implicitly a query (eg { ... }).

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #operation_typeString? + + + + + +

+
+

Returns The root type for this operation, or nil for implicit "query".

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + + — +

    The root type for this operation, or nil for implicit "query"

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+
+
+
# File 'lib/graphql/language/nodes.rb', line 517
+
+
+
+
+ + + +
+

+ + #selectionsArray<Field> + + + + + +

+
+

Returns Root-level fields on this operation.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Field>) + + + + — +

    Root-level fields on this operation

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+
+
+
# File 'lib/graphql/language/nodes.rb', line 514
+
+
+
+
+ + + +
+

+ + #variablesArray<VariableDefinition> + + + + + +

+
+

Returns Variable $definitions for this operation.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<VariableDefinition>) + + + + — +

    Variable $definitions for this operation

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+
+
+
# File 'lib/graphql/language/nodes.rb', line 511
+
+
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/ScalarTypeDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/ScalarTypeDefinition.html new file mode 100644 index 0000000000..dfb77c4327 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/ScalarTypeDefinition.html @@ -0,0 +1,237 @@ + + + + + + + Class: GraphQL::Language::Nodes::ScalarTypeDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::ScalarTypeDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+583
+584
+585
+
+
# File 'lib/graphql/language/nodes.rb', line 583
+
+def description
+  @description
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/ScalarTypeExtension.html b/api-doc/2.1.6/GraphQL/Language/Nodes/ScalarTypeExtension.html new file mode 100644 index 0000000000..1daef08e3e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/ScalarTypeExtension.html @@ -0,0 +1,151 @@ + + + + + + + Class: GraphQL::Language::Nodes::ScalarTypeExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::ScalarTypeExtension + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/SchemaDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/SchemaDefinition.html new file mode 100644 index 0000000000..75c2d7549d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/SchemaDefinition.html @@ -0,0 +1,157 @@ + + + + + + + Class: GraphQL::Language::Nodes::SchemaDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::SchemaDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/SchemaExtension.html b/api-doc/2.1.6/GraphQL/Language/Nodes/SchemaExtension.html new file mode 100644 index 0000000000..b639be9fe7 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/SchemaExtension.html @@ -0,0 +1,151 @@ + + + + + + + Class: GraphQL::Language::Nodes::SchemaExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::SchemaExtension + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/TypeName.html b/api-doc/2.1.6/GraphQL/Language/Nodes/TypeName.html new file mode 100644 index 0000000000..6498fd8d03 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/TypeName.html @@ -0,0 +1,169 @@ + + + + + + + Class: GraphQL::Language::Nodes::TypeName + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::TypeName + + + +

+
+ +
+
Inherits:
+
+ NameOnlyNode + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

A type name, used for variable definitions

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/UnionTypeDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/UnionTypeDefinition.html new file mode 100644 index 0000000000..31e7a0459a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/UnionTypeDefinition.html @@ -0,0 +1,307 @@ + + + + + + + Class: GraphQL::Language::Nodes::UnionTypeDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::UnionTypeDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
DefinitionNode
+
+ + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
  • + + + #types ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute types.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+674
+675
+676
+
+
# File 'lib/graphql/language/nodes.rb', line 674
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #typesObject (readonly) + + + + + +

+
+

Returns the value of attribute types.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+674
+675
+676
+
+
# File 'lib/graphql/language/nodes.rb', line 674
+
+def types
+  @types
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/UnionTypeExtension.html b/api-doc/2.1.6/GraphQL/Language/Nodes/UnionTypeExtension.html new file mode 100644 index 0000000000..8a3393bb92 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/UnionTypeExtension.html @@ -0,0 +1,231 @@ + + + + + + + Class: GraphQL::Language::Nodes::UnionTypeExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::UnionTypeExtension + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #types ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute types.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #typesObject (readonly) + + + + + +

+
+

Returns the value of attribute types.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+683
+684
+685
+
+
# File 'lib/graphql/language/nodes.rb', line 683
+
+def types
+  @types
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/VariableDefinition.html b/api-doc/2.1.6/GraphQL/Language/Nodes/VariableDefinition.html new file mode 100644 index 0000000000..4685274ed5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/VariableDefinition.html @@ -0,0 +1,333 @@ + + + + + + + Class: GraphQL::Language::Nodes::VariableDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::VariableDefinition + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

An operation-level query variable

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #default_valueString, ... + + + + + +

+
+

Returns A Ruby value to use if no other value is provided.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, Integer, Float, Boolean, Array, NullValue) + + + + — +

    A Ruby value to use if no other value is provided

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+
+
+
# File 'lib/graphql/language/nodes.rb', line 488
+
+
+
+
+ + + +
+

+ + #typeTypeName, ... + + + + + +

+
+

Returns The expected type of this value.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+
+
+
# File 'lib/graphql/language/nodes.rb', line 491
+
+
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/VariableIdentifier.html b/api-doc/2.1.6/GraphQL/Language/Nodes/VariableIdentifier.html new file mode 100644 index 0000000000..278242238f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/VariableIdentifier.html @@ -0,0 +1,169 @@ + + + + + + + Class: GraphQL::Language::Nodes::VariableIdentifier + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::VariableIdentifier + + + +

+
+ +
+
Inherits:
+
+ NameOnlyNode + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

Usage of a variable in a query. Name does not include $.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Nodes/WrapperType.html b/api-doc/2.1.6/GraphQL/Language/Nodes/WrapperType.html new file mode 100644 index 0000000000..7723d4ea41 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Nodes/WrapperType.html @@ -0,0 +1,165 @@ + + + + + + + Class: GraphQL::Language::Nodes::WrapperType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Nodes::WrapperType + + + +

+
+ +
+
Inherits:
+
+ AbstractNode + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/nodes.rb
+
+ +
+ +

Overview

+
+

Base class for non-null type names and list type names

+ + +
+
+
+ + +
+

Direct Known Subclasses

+

ListType, NonNullType

+
+ + + +

Constant Summary

+ +

Constants inherited + from AbstractNode

+

AbstractNode::NO_CHILDREN

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from AbstractNode

+

#col, #filename, #line

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from AbstractNode

+

#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Parser.html b/api-doc/2.1.6/GraphQL/Language/Parser.html new file mode 100644 index 0000000000..bcdbabe437 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Parser.html @@ -0,0 +1,359 @@ + + + + + + + Class: GraphQL::Language::Parser + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Parser + + + +

+
+ +
+
Inherits:
+
+ Racc::Parser + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/parser.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
Racc_arg = + +
+
[
+racc_action_table,
+racc_action_check,
+racc_action_default,
+racc_action_pointer,
+racc_goto_table,
+racc_goto_check,
+racc_goto_default,
+racc_goto_pointer,
+racc_nt_base,
+racc_reduce_table,
+racc_token_table,
+racc_shift_n,
+racc_reduce_n,
+racc_use_result_var ]
+ +
Racc_token_to_s_table = + +
+
[
+"$end",
+"error",
+"LCURLY",
+"RCURLY",
+"QUERY",
+"MUTATION",
+"SUBSCRIPTION",
+"LPAREN",
+"RPAREN",
+"VAR_SIGN",
+"COLON",
+"BANG",
+"LBRACKET",
+"RBRACKET",
+"EQUALS",
+"ON",
+"SCHEMA",
+"SCALAR",
+"TYPE",
+"IMPLEMENTS",
+"INTERFACE",
+"UNION",
+"ENUM",
+"INPUT",
+"DIRECTIVE",
+"IDENTIFIER",
+"FRAGMENT",
+"REPEATABLE",
+"TRUE",
+"FALSE",
+"NULL",
+"FLOAT",
+"INT",
+"STRING",
+"DIR_SIGN",
+"ELLIPSIS",
+"EXTEND",
+"AMP",
+"PIPE",
+"$start",
+"target",
+"document",
+"definitions_list",
+"definition",
+"executable_definition",
+"type_system_definition",
+"type_system_extension",
+"operation_definition",
+"fragment_definition",
+"operation_type",
+"operation_name_opt",
+"variable_definitions_opt",
+"directives_list_opt",
+"selection_set",
+"selection_list",
+"name",
+"variable_definitions_list",
+"variable_definition",
+"type",
+"default_value_opt",
+"nullable_type",
+"literal_value",
+"selection_set_opt",
+"selection",
+"field",
+"fragment_spread",
+"inline_fragment",
+"arguments_opt",
+"name_without_on",
+"schema_keyword",
+"enum_name",
+"enum_value_definition",
+"description_opt",
+"enum_value_definitions",
+"arguments_list",
+"argument",
+"input_value",
+"null_value",
+"enum_value",
+"list_value",
+"object_literal_value",
+"variable",
+"object_value",
+"list_value_list",
+"object_value_list",
+"object_value_field",
+"object_literal_value_list",
+"object_literal_value_field",
+"directives_list",
+"directive",
+"fragment_name_opt",
+"schema_definition",
+"type_definition",
+"directive_definition",
+"operation_type_definition_list_opt",
+"operation_type_definition_list",
+"operation_type_definition",
+"scalar_type_definition",
+"object_type_definition",
+"interface_type_definition",
+"union_type_definition",
+"enum_type_definition",
+"input_object_type_definition",
+"schema_extension",
+"type_extension",
+"scalar_type_extension",
+"object_type_extension",
+"interface_type_extension",
+"union_type_extension",
+"enum_type_extension",
+"input_object_type_extension",
+"implements",
+"field_definition_list_opt",
+"implements_opt",
+"union_members",
+"input_value_definition_list",
+"description",
+"interfaces_list",
+"legacy_interfaces_list",
+"input_value_definition",
+"arguments_definitions_opt",
+"field_definition",
+"field_definition_list",
+"directive_repeatable_opt",
+"directive_locations" ]
+ +
Racc_debug_parser = + +
+
false
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + +
+

Instance Method Details

+ + +
+

+ + #_reduce_none(val, _values, result) ⇒ Object + + + + + +

+ + + + +
+
+
+
+2025
+2026
+2027
+
+
# File 'lib/graphql/language/parser.rb', line 2025
+
+def _reduce_none(val, _values, result)
+  val[0]
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Printer.html b/api-doc/2.1.6/GraphQL/Language/Printer.html new file mode 100644 index 0000000000..f1e25653ec --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Printer.html @@ -0,0 +1,334 @@ + + + + + + + Class: GraphQL::Language::Printer + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Printer + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/printer.rb
+
+ +
+ + +

Defined Under Namespace

+

+ + + + + Classes: TruncatableBuffer + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
OMISSION = + +
+
"... (truncated)"
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+
+
+

Turn an arbitrary AST node back into a string.

+ + +
+
+
+ +
+

Examples:

+ + +

Turning a document into a query string

+

+ +
document = GraphQL.parse(query_string)
+GraphQL::Language::Printer.new.print(document)
+# => "{ ... }"
+ + +

Building a custom printer

+

+ +

+class MyPrinter < GraphQL::Language::Printer
+  def print_argument(arg)
+    print_string("#{arg.name}: <HIDDEN>")
+  end
+end
+
+MyPrinter.new.print(document)
+# => "mutation { pay(creditCard: <HIDDEN>) { success } }"
+ +
+

Parameters:

+
    + +
  • + + node + + + (Nodes::AbstractNode) + + + +
  • + +
  • + + indent + + + (String) + + + (defaults to: "") + + + — +

    Whitespace to add to the printed node

    +
    + +
  • + +
  • + + truncate_size + + + (Integer, nil) + + + (defaults to: nil) + + + — +

    The size to truncate to.

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    Valid GraphQL for node

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+
+
# File 'lib/graphql/language/printer.rb', line 54
+
+def print(node, indent: "", truncate_size: nil)
+  truncate_size = truncate_size ? [truncate_size - OMISSION.size, 0].max : nil
+  @out = TruncatableBuffer.new(truncate_size: truncate_size)
+  print_node(node, indent: indent)
+  @out.to_string
+rescue TruncatableBuffer::TruncateSizeReached
+  @out.to_string << OMISSION
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Printer/TruncatableBuffer.html b/api-doc/2.1.6/GraphQL/Language/Printer/TruncatableBuffer.html new file mode 100644 index 0000000000..6581881664 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Printer/TruncatableBuffer.html @@ -0,0 +1,351 @@ + + + + + + + Class: GraphQL::Language::Printer::TruncatableBuffer + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Printer::TruncatableBuffer + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/printer.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: TruncateSizeReached + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
DEFAULT_INIT_CAPACITY = + +
+
500
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(truncate_size: nil) ⇒ TruncatableBuffer + + + + + +

+
+

Returns a new instance of TruncatableBuffer.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+12
+13
+14
+15
+
+
# File 'lib/graphql/language/printer.rb', line 12
+
+def initialize(truncate_size: nil)
+  @out = String.new(capacity: truncate_size || DEFAULT_INIT_CAPACITY)
+  @truncate_size = truncate_size
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #append(other) ⇒ Object + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'lib/graphql/language/printer.rb', line 17
+
+def append(other)
+  if @truncate_size && (@out.size + other.size) > @truncate_size
+    @out << other.slice(0, @truncate_size - @out.size)
+    raise(TruncateSizeReached, "Truncate size reached")
+  else
+    @out << other
+  end
+end
+
+
+ +
+

+ + #to_stringObject + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/language/printer.rb', line 26
+
+def to_string
+  @out
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Printer/TruncatableBuffer/TruncateSizeReached.html b/api-doc/2.1.6/GraphQL/Language/Printer/TruncatableBuffer/TruncateSizeReached.html new file mode 100644 index 0000000000..2e6ac72340 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Printer/TruncatableBuffer/TruncateSizeReached.html @@ -0,0 +1,124 @@ + + + + + + + Exception: GraphQL::Language::Printer::TruncatableBuffer::TruncateSizeReached + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Language::Printer::TruncatableBuffer::TruncateSizeReached + + + +

+
+ +
+
Inherits:
+
+ StandardError + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/printer.rb
+
+ +
+ + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/SanitizedPrinter.html b/api-doc/2.1.6/GraphQL/Language/SanitizedPrinter.html new file mode 100644 index 0000000000..4dfadd588a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/SanitizedPrinter.html @@ -0,0 +1,1188 @@ + + + + + + + Class: GraphQL::Language::SanitizedPrinter + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::SanitizedPrinter + + + +

+
+ +
+
Inherits:
+
+ Printer + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/sanitized_printer.rb
+
+ +
+ +

Overview

+
+

A custom printer used to print sanitized queries. It inlines provided variables +within the query for facilitate logging and analysis of queries.

+ +

The printer returns nil if the query is invalid.

+ +

Since the GraphQL Ruby AST for a GraphQL query doesnt contain any reference +on the type of fields or arguments, we have to track the current object, field +and input type while printing the query.

+ + +
+
+
+ +
+

Examples:

+ + +

Printing a scrubbed string

+

+ +
printer = QueryPrinter.new(query)
+puts printer.sanitized_query_string
+ +
+ + +

See Also:

+
    + +
  • {Query{Query#sanitized_query_string}
  • + +
+ +
+ +

+ Constant Summary + collapse +

+ +
+ +
REDACTED = + +
+
"\"<REDACTED>\""
+ +
+ + + + + + +

Constants inherited + from Printer

+

Printer::OMISSION

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Printer

+

#print

+
+

Constructor Details

+ +
+

+ + #initialize(query, inline_variables: true) ⇒ SanitizedPrinter + + + + + +

+
+

Returns a new instance of SanitizedPrinter.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 22
+
+def initialize(query, inline_variables: true)
+  @query = query
+  @current_type = nil
+  @current_field = nil
+  @current_input_type = nil
+  @inline_variables = inline_variables
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #coerce_argument_value_to_list?(type, value) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+99
+100
+101
+102
+103
+104
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 99
+
+def coerce_argument_value_to_list?(type, value)
+  type.list? &&
+    !value.is_a?(Array) &&
+    !value.nil? &&
+    !value.is_a?(GraphQL::Language::Nodes::VariableIdentifier)
+end
+
+
+ +
+ + + + + +
+
+
+
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 75
+
+def print_argument(argument)
+  # We won't have type information if we're recursing into a custom scalar
+  return super if @current_input_type && @current_input_type.kind.scalar?
+
+  arg_owner = @current_input_type || @current_directive || @current_field
+  old_current_argument = @current_argument
+  @current_argument = arg_owner.get_argument(argument.name, @query.context)
+
+  old_input_type = @current_input_type
+  @current_input_type = @current_argument.type.non_null? ? @current_argument.type.of_type : @current_argument.type
+
+  argument_value = if coerce_argument_value_to_list?(@current_input_type, argument.value)
+    [argument.value]
+  else
+    argument.value
+  end
+
+  print_string("#{argument.name}: ")
+  print_node(argument_value)
+
+  @current_input_type = old_input_type
+  @current_argument = old_current_argument
+end
+
+
+ +
+ + + + + +
+
+
+
+144
+145
+146
+147
+148
+149
+150
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 144
+
+def print_directive(directive)
+  @current_directive = query.schema.directives[directive.name]
+
+  super
+
+  @current_directive = nil
+end
+
+
+ +
+ + + + + +
+
+
+
+115
+116
+117
+118
+119
+120
+121
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 115
+
+def print_field(field, indent: "")
+  @current_field = query.get_field(@current_type, field.name)
+  old_type = @current_type
+  @current_type = @current_field.type.unwrap
+  super
+  @current_type = old_type
+end
+
+
+ +
+ + + + + +
+
+
+
+135
+136
+137
+138
+139
+140
+141
+142
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 135
+
+def print_fragment_definition(fragment_def, indent: "")
+  old_type = @current_type
+  @current_type = query.get_type(fragment_def.type.name)
+
+  super
+
+  @current_type = old_type
+end
+
+
+ +
+ + + + + +
+
+
+
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 123
+
+def print_inline_fragment(inline_fragment, indent: "")
+  old_type = @current_type
+
+  if inline_fragment.type
+    @current_type = query.get_type(inline_fragment.type.name)
+  end
+
+  super
+
+  @current_type = old_type
+end
+
+
+ +
+ + + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 39
+
+def print_node(node, indent: "")
+  case node
+  when FalseClass, Float, Integer, String, TrueClass
+    if @current_argument && redact_argument_value?(@current_argument, node)
+      print_string(redacted_argument_value(@current_argument))
+    else
+      super
+    end
+  when Array
+    old_input_type = @current_input_type
+    if @current_input_type && @current_input_type.list?
+      @current_input_type = @current_input_type.of_type
+      @current_input_type = @current_input_type.of_type if @current_input_type.non_null?
+    end
+
+    super
+    @current_input_type = old_input_type
+  else
+    super
+  end
+end
+
+
+ +
+
+
+

Print the operation definition but do not include the variable +definitions since we will inline them within the query

+ + +
+
+
+ + +
+ + + + +
+
+
+
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 154
+
+def print_operation_definition(operation_definition, indent: "")
+  old_type = @current_type
+  @current_type = query.schema.public_send(operation_definition.operation_type)
+
+  if @inline_variables
+    print_string("#{indent}#{operation_definition.operation_type}")
+    print_string(" #{operation_definition.name}") if operation_definition.name
+    print_directives(operation_definition.directives)
+    print_selections(operation_definition.selections, indent: indent)
+  else
+    super
+  end
+
+  @current_type = old_type
+end
+
+
+ +
+ + + + + +
+
+
+
+106
+107
+108
+109
+110
+111
+112
+113
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 106
+
+def print_variable_identifier(variable_id)
+  if @inline_variables
+    variable_value = query.variables[variable_id.name]
+    print_node(value_to_ast(variable_value, @current_input_type))
+  else
+    super
+  end
+end
+
+
+ +
+

+ + #redact_argument_value?(argument, value) ⇒ Boolean + + + + + +

+
+

Indicates whether or not to redact non-null values for the given argument. Defaults to redacting all strings +arguments but this can be customized by subclasses.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+63
+64
+65
+66
+67
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 63
+
+def redact_argument_value?(argument, value)
+  # Default to redacting any strings or custom scalars encoded as strings
+  type = argument.type.unwrap
+  value.is_a?(String) && type.kind.scalar? && (type.graphql_name == "String" || !type.default_scalar?)
+end
+
+
+ +
+

+ + #redacted_argument_value(argument) ⇒ Object + + + + + +

+
+

Returns the value to use for redacted versions of the given argument. Defaults to the +string “".

+ + +
+
+
+ + +
+ + + + +
+
+
+
+71
+72
+73
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 71
+
+def redacted_argument_value(argument)
+  REDACTED
+end
+
+
+ +
+

+ + #sanitized_query_stringString? + + + + + +

+
+

Returns A scrubbed query string, if the query was valid.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + + — +

    A scrubbed query string, if the query was valid.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+37
+
+
# File 'lib/graphql/language/sanitized_printer.rb', line 31
+
+def sanitized_query_string
+  if query.valid?
+    print(query.document)
+  else
+    nil
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/StaticVisitor.html b/api-doc/2.1.6/GraphQL/Language/StaticVisitor.html new file mode 100644 index 0000000000..f86e3092c5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/StaticVisitor.html @@ -0,0 +1,888 @@ + + + + + + + Class: GraphQL::Language::StaticVisitor + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::StaticVisitor + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/static_visitor.rb
+
+ +
+ +

Overview

+
+

Like GraphQL::Language::Visitor except it doesn’t support +making changes to the document – only visiting it as-is.

+ + +
+
+
+ + +
+ + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(document) ⇒ StaticVisitor + + + + + +

+
+

Returns a new instance of StaticVisitor.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/language/static_visitor.rb', line 7
+
+def initialize(document)
+  @document = document
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .make_visit_methods(ast_node_class) ⇒ Object + + + + + +

+
+

We don’t use alias here because it breaks super

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+
+
# File 'lib/graphql/language/static_visitor.rb', line 26
+
+def self.make_visit_methods(ast_node_class)
+  node_method = ast_node_class.visit_method
+  children_of_type = ast_node_class.children_of_type
+  child_visit_method = :"#{node_method}_children"
+
+  class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
+    # The default implementation for visiting an AST node.
+    # It doesn't _do_ anything, but it continues to visiting the node's children.
+    # To customize this hook, override one of its make_visit_methods (or the base method?)
+    # in your subclasses.
+    #
+    # @param node [GraphQL::Language::Nodes::AbstractNode] the node being visited
+    # @param parent [GraphQL::Language::Nodes::AbstractNode, nil] the previously-visited node, or `nil` if this is the root node.
+    # @return [void]
+    def #{node_method}(node, parent)
+      #{
+        if method_defined?(child_visit_method)
+          "#{child_visit_method}(node)"
+        elsif children_of_type
+          children_of_type.map do |child_accessor, child_class|
+            "node.#{child_accessor}.each do |child_node|
+              #{child_class.visit_method}(child_node, node)
+            end"
+          end.join("\n")
+        else
+          ""
+        end
+      }
+    end
+  RUBY
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #on_argument_children(new_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+
+
# File 'lib/graphql/language/static_visitor.rb', line 109
+
+def on_argument_children(new_node)
+  new_node.children.each do |value_node|
+    case value_node
+    when Language::Nodes::VariableIdentifier
+      on_variable_identifier(value_node, new_node)
+    when Language::Nodes::InputObject
+      on_input_object(value_node, new_node)
+    when Language::Nodes::Enum
+      on_enum(value_node, new_node)
+    when Language::Nodes::NullValue
+      on_null_value(value_node, new_node)
+    else
+      raise ArgumentError, "Invariant: unexpected argument value node #{value_node.class} (#{value_node.inspect})"
+    end
+  end
+end
+
+
+ +
+

+ + #on_document_children(document_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+58
+59
+60
+61
+62
+63
+
+
# File 'lib/graphql/language/static_visitor.rb', line 58
+
+def on_document_children(document_node)
+  document_node.children.each do |child_node|
+    visit_method = child_node.visit_method
+    public_send(visit_method, child_node, document_node)
+  end
+end
+
+
+ +
+

+ + #on_field_children(new_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+65
+66
+67
+68
+69
+70
+71
+
+
# File 'lib/graphql/language/static_visitor.rb', line 65
+
+def on_field_children(new_node)
+  new_node.arguments.each do |arg_node| # rubocop:disable Development/ContextIsPassedCop
+    on_argument(arg_node, new_node)
+  end
+  visit_directives(new_node)
+  visit_selections(new_node)
+end
+
+
+ +
+

+ + #on_fragment_definition_children(new_node) ⇒ Object + + + + Also known as: + on_inline_fragment_children + + + + +

+ + + + +
+
+
+
+94
+95
+96
+97
+
+
# File 'lib/graphql/language/static_visitor.rb', line 94
+
+def on_fragment_definition_children(new_node)
+  visit_directives(new_node)
+  visit_selections(new_node)
+end
+
+
+ +
+

+ + #on_operation_definition_children(new_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+101
+102
+103
+104
+105
+106
+107
+
+
# File 'lib/graphql/language/static_visitor.rb', line 101
+
+def on_operation_definition_children(new_node)
+  new_node.variables.each do |arg_node|
+    on_variable_definition(arg_node, new_node)
+  end
+  visit_directives(new_node)
+  visit_selections(new_node)
+end
+
+
+ +
+

+ + #visitvoid + + + + + +

+
+

This method returns an undefined value.

Visit document and all children

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
+
# File 'lib/graphql/language/static_visitor.rb', line 13
+
+def visit
+  # `@document` may be any kind of node:
+  visit_method = @document.visit_method
+  result = public_send(visit_method, @document, nil)
+  @result = if result.is_a?(Array)
+    result.first
+  else
+    # The node wasn't modified
+    @document
+  end
+end
+
+
+ +
+

+ + #visit_directives(new_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+73
+74
+75
+76
+77
+
+
# File 'lib/graphql/language/static_visitor.rb', line 73
+
+def visit_directives(new_node)
+  new_node.directives.each do |dir_node|
+    on_directive(dir_node, new_node)
+  end
+end
+
+
+ +
+

+ + #visit_selections(new_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+
+
# File 'lib/graphql/language/static_visitor.rb', line 79
+
+def visit_selections(new_node)
+  new_node.selections.each do |selection|
+    case selection
+    when GraphQL::Language::Nodes::Field
+      on_field(selection, new_node)
+    when GraphQL::Language::Nodes::InlineFragment
+      on_inline_fragment(selection, new_node)
+    when GraphQL::Language::Nodes::FragmentSpread
+      on_fragment_spread(selection, new_node)
+    else
+      raise ArgumentError, "Invariant: unexpected field selection #{selection.class} (#{selection.inspect})"
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Token.html b/api-doc/2.1.6/GraphQL/Language/Token.html new file mode 100644 index 0000000000..6905ed5b1d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Token.html @@ -0,0 +1,830 @@ + + + + + + + Class: GraphQL::Language::Token + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Token + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/token.rb
+
+ +
+ +

Overview

+
+

Emitted by the lexer and passed to the parser. +Contains type, value and position data.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #col ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute col.

    +
    + +
  • + + +
  • + + + #line ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute line.

    +
    + +
  • + + +
  • + + + #name ⇒ Symbol + + + + + + + + + readonly + + + + + + + + + +

    The kind of token this is.

    +
    + +
  • + + +
  • + + + #prev_token ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute prev_token.

    +
    + +
  • + + +
  • + + + #value ⇒ String + + + + (also: #to_s) + + + + + + + readonly + + + + + + + + + +

    The text of this token.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(name, value, line, col, prev_token) ⇒ Token + + + + + +

+
+

Returns a new instance of Token.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+
+
# File 'lib/graphql/language/token.rb', line 13
+
+def initialize(name, value, line, col, prev_token)
+  @name = name
+  @value = -value
+  @line = line
+  @col = col
+  @prev_token = prev_token
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #colObject (readonly) + + + + + +

+
+

Returns the value of attribute col.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'lib/graphql/language/token.rb', line 11
+
+def col
+  @col
+end
+
+
+ + + +
+

+ + #lineObject (readonly) + + + + + +

+
+

Returns the value of attribute line.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'lib/graphql/language/token.rb', line 11
+
+def line
+  @line
+end
+
+
+ + + +
+

+ + #nameSymbol (readonly) + + + + + +

+
+

Returns The kind of token this is.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Symbol) + + + + — +

    The kind of token this is

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/language/token.rb', line 8
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #prev_tokenObject (readonly) + + + + + +

+
+

Returns the value of attribute prev_token.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'lib/graphql/language/token.rb', line 11
+
+def prev_token
+  @prev_token
+end
+
+
+ + + +
+

+ + #valueString (readonly) + + + + Also known as: + to_s + + + + +

+
+

Returns The text of this token.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    The text of this token

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'lib/graphql/language/token.rb', line 10
+
+def value
+  @value
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/graphql/language/token.rb', line 29
+
+def inspect
+  "(#{@name} #{@value.inspect} [#{@line}:#{@col}])"
+end
+
+
+ +
+

+ + #line_and_columnObject + + + + + +

+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'lib/graphql/language/token.rb', line 25
+
+def line_and_column
+  [@line, @col]
+end
+
+
+ +
+

+ + #to_fObject + + + + + +

+ + + + +
+
+
+
+23
+
+
# File 'lib/graphql/language/token.rb', line 23
+
+def to_f; @value.to_f; end
+
+
+ +
+

+ + #to_iObject + + + + + +

+ + + + +
+
+
+
+22
+
+
# File 'lib/graphql/language/token.rb', line 22
+
+def to_i; @value.to_i; end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Visitor.html b/api-doc/2.1.6/GraphQL/Language/Visitor.html new file mode 100644 index 0000000000..fff7d3cfbc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Visitor.html @@ -0,0 +1,1170 @@ + + + + + + + Class: GraphQL::Language::Visitor + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Visitor + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/visitor.rb
+
+ +
+ +

Overview

+
+

Depth-first traversal through the tree, calling hooks at each stop.

+ + +
+
+
+ +
+

Examples:

+ + +

Create a visitor counting certain field names

+

+ +
class NameCounter < GraphQL::Language::Visitor
+  def initialize(document, field_name)
+    super(document)
+    @field_name = field_name
+    @count = 0
+  end
+
+  attr_reader :count
+
+  def on_field(node, parent)
+    # if this field matches our search, increment the counter
+    if node.name == @field_name
+      @count += 1
+    end
+    # Continue visiting subfields:
+    super
+  end
+end
+
+# Initialize a visitor
+visitor = NameCounter.new(document, "name")
+# Run it
+visitor.visit
+# Check the result
+visitor.count
+# => 3
+ +
+ + +

See Also:

+ + +

Defined Under Namespace

+

+ + + + + Classes: DeleteNode + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
DELETE_NODE = +
+
+

When this is returned from a visitor method, +Then the node passed into the method is removed from parent’s children.

+ + +
+
+
+ + +
+
+
DeleteNode.new
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(document) ⇒ Visitor + + + + + +

+
+

Returns a new instance of Visitor.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+42
+43
+44
+45
+
+
# File 'lib/graphql/language/visitor.rb', line 42
+
+def initialize(document)
+  @document = document
+  @result = nil
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #resultGraphQL::Language::Nodes::Document (readonly) + + + + + +

+
+

Returns The document with any modifications applied.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'lib/graphql/language/visitor.rb', line 48
+
+def result
+  @result
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .make_visit_methods(ast_node_class) ⇒ Object + + + + + +

+
+

We don’t use alias here because it breaks super

+ + +
+
+
+ + +
+ + + + +
+
+
+
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+
+
# File 'lib/graphql/language/visitor.rb', line 65
+
+def self.make_visit_methods(ast_node_class)
+  node_method = ast_node_class.visit_method
+  children_of_type = ast_node_class.children_of_type
+  child_visit_method = :"#{node_method}_children"
+
+  class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
+    # The default implementation for visiting an AST node.
+    # It doesn't _do_ anything, but it continues to visiting the node's children.
+    # To customize this hook, override one of its make_visit_methods (or the base method?)
+    # in your subclasses.
+    #
+    # @param node [GraphQL::Language::Nodes::AbstractNode] the node being visited
+    # @param parent [GraphQL::Language::Nodes::AbstractNode, nil] the previously-visited node, or `nil` if this is the root node.
+    # @return [Array, nil] If there were modifications, it returns an array of new nodes, otherwise, it returns `nil`.
+    def #{node_method}(node, parent)
+      if node.equal?(DELETE_NODE)
+        # This might be passed to `super(DELETE_NODE, ...)`
+        # by a user hook, don't want to keep visiting in that case.
+        [node, parent]
+      else
+        new_node = node
+        #{
+          if method_defined?(child_visit_method)
+            "new_node = #{child_visit_method}(new_node)"
+          elsif children_of_type
+            children_of_type.map do |child_accessor, child_class|
+              "node.#{child_accessor}.each do |child_node|
+                new_child_and_node = #{child_class.visit_method}_with_modifications(child_node, new_node)
+                # Reassign `node` in case the child hook makes a modification
+                if new_child_and_node.is_a?(Array)
+                  new_node = new_child_and_node[1]
+                end
+              end"
+            end.join("\n")
+          else
+            ""
+          end
+        }
+
+        if new_node.equal?(node)
+          [node, parent]
+        else
+          [new_node, parent]
+        end
+      end
+    end
+
+    def #{node_method}_with_modifications(node, parent)
+      new_node_and_new_parent = #{node_method}(node, parent)
+      apply_modifications(node, parent, new_node_and_new_parent)
+    end
+  RUBY
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #on_argument_children(new_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+
+
# File 'lib/graphql/language/visitor.rb', line 197
+
+def on_argument_children(new_node)
+  new_node.children.each do |value_node|
+    new_child_and_node = case value_node
+    when Language::Nodes::VariableIdentifier
+      on_variable_identifier_with_modifications(value_node, new_node)
+    when Language::Nodes::InputObject
+      on_input_object_with_modifications(value_node, new_node)
+    when Language::Nodes::Enum
+      on_enum_with_modifications(value_node, new_node)
+    when Language::Nodes::NullValue
+      on_null_value_with_modifications(value_node, new_node)
+    else
+      raise ArgumentError, "Invariant: unexpected argument value node #{value_node.class} (#{value_node.inspect})"
+    end
+    # Reassign `node` in case the child hook makes a modification
+    if new_child_and_node.is_a?(Array)
+      new_node = new_child_and_node[1]
+    end
+  end
+  new_node
+end
+
+
+ +
+

+ + #on_document_children(document_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+
+
# File 'lib/graphql/language/visitor.rb', line 119
+
+def on_document_children(document_node)
+  new_node = document_node
+  document_node.children.each do |child_node|
+    visit_method = :"#{child_node.visit_method}_with_modifications"
+    new_child_and_node = public_send(visit_method, child_node, new_node)
+    # Reassign `node` in case the child hook makes a modification
+    if new_child_and_node.is_a?(Array)
+      new_node = new_child_and_node[1]
+    end
+  end
+  new_node
+end
+
+
+ +
+

+ + #on_field_children(new_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+
+
# File 'lib/graphql/language/visitor.rb', line 132
+
+def on_field_children(new_node)
+  new_node.arguments.each do |arg_node| # rubocop:disable Development/ContextIsPassedCop
+    new_child_and_node = on_argument_with_modifications(arg_node, new_node)
+    # Reassign `node` in case the child hook makes a modification
+    if new_child_and_node.is_a?(Array)
+      new_node = new_child_and_node[1]
+    end
+  end
+  new_node = visit_directives(new_node)
+  new_node = visit_selections(new_node)
+  new_node
+end
+
+
+ +
+

+ + #on_fragment_definition_children(new_node) ⇒ Object + + + + Also known as: + on_inline_fragment_children + + + + +

+ + + + +
+
+
+
+176
+177
+178
+179
+180
+
+
# File 'lib/graphql/language/visitor.rb', line 176
+
+def on_fragment_definition_children(new_node)
+  new_node = visit_directives(new_node)
+  new_node = visit_selections(new_node)
+  new_node
+end
+
+
+ +
+

+ + #on_operation_definition_children(new_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+
+
# File 'lib/graphql/language/visitor.rb', line 184
+
+def on_operation_definition_children(new_node)
+  new_node.variables.each do |arg_node|
+    new_child_and_node = on_variable_definition_with_modifications(arg_node, new_node)
+    # Reassign `node` in case the child hook makes a modification
+    if new_child_and_node.is_a?(Array)
+      new_node = new_child_and_node[1]
+    end
+  end
+  new_node = visit_directives(new_node)
+  new_node = visit_selections(new_node)
+  new_node
+end
+
+
+ +
+

+ + #visitvoid + + + + + +

+
+

This method returns an undefined value.

Visit document and all children

+ + +
+
+
+ + +
+ + + + +
+
+
+
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+
+
# File 'lib/graphql/language/visitor.rb', line 52
+
+def visit
+  # `@document` may be any kind of node:
+  visit_method = :"#{@document.visit_method}_with_modifications"
+  result = public_send(visit_method, @document, nil)
+  @result = if result.is_a?(Array)
+    result.first
+  else
+    # The node wasn't modified
+    @document
+  end
+end
+
+
+ +
+

+ + #visit_directives(new_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+
+
# File 'lib/graphql/language/visitor.rb', line 145
+
+def visit_directives(new_node)
+  new_node.directives.each do |dir_node|
+    new_child_and_node = on_directive_with_modifications(dir_node, new_node)
+    # Reassign `node` in case the child hook makes a modification
+    if new_child_and_node.is_a?(Array)
+      new_node = new_child_and_node[1]
+    end
+  end
+  new_node
+end
+
+
+ +
+

+ + #visit_selections(new_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+
+
# File 'lib/graphql/language/visitor.rb', line 156
+
+def visit_selections(new_node)
+  new_node.selections.each do |selection|
+    new_child_and_node = case selection
+    when GraphQL::Language::Nodes::Field
+      on_field_with_modifications(selection, new_node)
+    when GraphQL::Language::Nodes::InlineFragment
+      on_inline_fragment_with_modifications(selection, new_node)
+    when GraphQL::Language::Nodes::FragmentSpread
+      on_fragment_spread_with_modifications(selection, new_node)
+    else
+      raise ArgumentError, "Invariant: unexpected field selection #{selection.class} (#{selection.inspect})"
+    end
+    # Reassign `node` in case the child hook makes a modification
+    if new_child_and_node.is_a?(Array)
+      new_node = new_child_and_node[1]
+    end
+  end
+  new_node
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Language/Visitor/DeleteNode.html b/api-doc/2.1.6/GraphQL/Language/Visitor/DeleteNode.html new file mode 100644 index 0000000000..89164bcaa6 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Language/Visitor/DeleteNode.html @@ -0,0 +1,121 @@ + + + + + + + Class: GraphQL::Language::Visitor::DeleteNode + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Language::Visitor::DeleteNode + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/language/visitor.rb
+
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/LoadApplicationObjectFailedError.html b/api-doc/2.1.6/GraphQL/LoadApplicationObjectFailedError.html new file mode 100644 index 0000000000..1c0bbea32d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/LoadApplicationObjectFailedError.html @@ -0,0 +1,610 @@ + + + + + + + Exception: GraphQL::LoadApplicationObjectFailedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::LoadApplicationObjectFailedError + + + +

+
+ +
+
Inherits:
+
+ ExecutionError + +
    +
  • Object
  • + + + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/load_application_object_failed_error.rb
+
+ +
+ +

Overview

+
+

Raised when a argument is configured with loads: and the client provides an ID, +but no object is loaded for that ID.

+ + +
+
+
+ + +

See Also:

+
    + +
  • A hook which you can override in resolvers, mutations and input objects.
  • + +
+ +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes inherited from ExecutionError

+

#ast_node, #extensions, #options, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from ExecutionError

+

#to_h

+ + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(argument:, id:, object:, context:) ⇒ LoadApplicationObjectFailedError + + + + + +

+
+

Returns a new instance of LoadApplicationObjectFailedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'lib/graphql/load_application_object_failed_error.rb', line 18
+
+def initialize(argument:, id:, object:, context:)
+  @id = id
+  @argument = argument
+  @object = object
+  @context = context
+  super("No object found for `#{argument.graphql_name}: #{id.inspect}`")
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argumentGraphQL::Schema::Argument (readonly) + + + + + +

+
+

Returns the argument definition for the argument that was looked up.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'lib/graphql/load_application_object_failed_error.rb', line 10
+
+def argument
+  @argument
+end
+
+
+ + + +
+

+ + #contextGraphQL::Query::Context (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/load_application_object_failed_error.rb', line 16
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #idString (readonly) + + + + + +

+
+

Returns The ID provided by the client.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    The ID provided by the client

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/load_application_object_failed_error.rb', line 12
+
+def id
+  @id
+end
+
+
+ + + +
+

+ + #objectObject (readonly) + + + + + +

+
+

Returns The value found with this ID.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The value found with this ID

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/load_application_object_failed_error.rb', line 14
+
+def object
+  @object
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/NameValidator.html b/api-doc/2.1.6/GraphQL/NameValidator.html new file mode 100644 index 0000000000..626161173d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/NameValidator.html @@ -0,0 +1,232 @@ + + + + + + + Class: GraphQL::NameValidator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::NameValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/name_validator.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
VALID_NAME_REGEX = + +
+
/^[_a-zA-Z][_a-zA-Z0-9]*$/
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .validate!(name) ⇒ Object + + + + + +

+
+ + + +
+
+
+ +

Raises:

+ + +
+ + + + +
+
+
+
+6
+7
+8
+9
+
+
# File 'lib/graphql/name_validator.rb', line 6
+
+def self.validate!(name)
+  name = name.is_a?(String) ? name : name.to_s
+  raise GraphQL::InvalidNameError.new(name, VALID_NAME_REGEX) unless name.match?(VALID_NAME_REGEX)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination.html b/api-doc/2.1.6/GraphQL/Pagination.html new file mode 100644 index 0000000000..5131bcf8fe --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination.html @@ -0,0 +1,117 @@ + + + + + + + Module: GraphQL::Pagination + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Pagination + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/connection.rb,
+ lib/graphql/pagination/connections.rb,
lib/graphql/pagination/array_connection.rb,
lib/graphql/pagination/relation_connection.rb,
lib/graphql/pagination/sequel_dataset_connection.rb,
lib/graphql/pagination/mongoid_relation_connection.rb,
lib/graphql/pagination/active_record_relation_connection.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: ActiveRecordRelationConnection, ArrayConnection, Connection, Connections, MongoidRelationConnection, RelationConnection, SequelDatasetConnection + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination/ActiveRecordRelationConnection.html b/api-doc/2.1.6/GraphQL/Pagination/ActiveRecordRelationConnection.html new file mode 100644 index 0000000000..db4c8b7ae9 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination/ActiveRecordRelationConnection.html @@ -0,0 +1,168 @@ + + + + + + + Class: GraphQL::Pagination::ActiveRecordRelationConnection + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Pagination::ActiveRecordRelationConnection + + + +

+
+ +
+
Inherits:
+
+ RelationConnection + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/active_record_relation_connection.rb
+
+ +
+ +

Overview

+
+

Customizes RelationConnection to work with ActiveRecord::Relations.

+ + +
+
+
+ + +
+ + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Connection

+

#after_value, #arguments, #before_value, #context, #edge_class, #field, #first, #first_value, #items, #last, #last_value, #parent

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from RelationConnection

+

#cursor_for, #has_next_page, #has_previous_page, #nodes

+ + + + + + + + + +

Methods inherited from Connection

+

#after, #before, #cursor_for, #default_page_size, #default_page_size=, #edge_nodes, #edges, #end_cursor, #has_default_page_size_override?, #has_max_page_size_override?, #has_next_page, #has_previous_page, #initialize, #max_page_size, #max_page_size=, #nodes, #page_info, #range_add_edge, #start_cursor, #was_authorized_by_scope_items?

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Pagination::Connection

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination/ArrayConnection.html b/api-doc/2.1.6/GraphQL/Pagination/ArrayConnection.html new file mode 100644 index 0000000000..680fc2bffa --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination/ArrayConnection.html @@ -0,0 +1,382 @@ + + + + + + + Class: GraphQL::Pagination::ArrayConnection + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Pagination::ArrayConnection + + + +

+
+ +
+
Inherits:
+
+ Connection + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/array_connection.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Connection

+

#after_value, #arguments, #before_value, #context, #edge_class, #field, #first, #first_value, #items, #last, #last_value, #parent

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Connection

+

#after, #before, #default_page_size, #default_page_size=, #edge_nodes, #edges, #end_cursor, #has_default_page_size_override?, #has_max_page_size_override?, #initialize, #max_page_size, #max_page_size=, #page_info, #range_add_edge, #start_cursor, #was_authorized_by_scope_items?

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Pagination::Connection

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #cursor_for(item) ⇒ Object + + + + + +

+ + + + +
+
+
+
+22
+23
+24
+25
+
+
# File 'lib/graphql/pagination/array_connection.rb', line 22
+
+def cursor_for(item)
+  idx = items.find_index(item) + 1
+  encode(idx.to_s)
+end
+
+
+ +
+

+ + #has_next_pageObject + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+
+
# File 'lib/graphql/pagination/array_connection.rb', line 17
+
+def has_next_page
+  load_nodes
+  @has_next_page
+end
+
+
+ +
+

+ + #has_previous_pageObject + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+15
+
+
# File 'lib/graphql/pagination/array_connection.rb', line 12
+
+def has_previous_page
+  load_nodes
+  @has_previous_page
+end
+
+
+ +
+

+ + #nodesObject + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/pagination/array_connection.rb', line 7
+
+def nodes
+  load_nodes
+  @nodes
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination/Connection.html b/api-doc/2.1.6/GraphQL/Pagination/Connection.html new file mode 100644 index 0000000000..a4d0bd722f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination/Connection.html @@ -0,0 +1,2924 @@ + + + + + + + Class: GraphQL::Pagination::Connection + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Pagination::Connection + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/connection.rb
+
+ +
+ +

Overview

+
+

A Connection wraps a list of items and provides cursor-based pagination over it.

+ +

Connections were introduced by Facebook’s Relay front-end framework, but +proved to be generally useful for GraphQL APIs. When in doubt, use connections +to serve lists (like Arrays, ActiveRecord::Relations) via GraphQL.

+ +

Unlike the previous connection implementation, these default to bidirectional pagination.

+ +

Pagination arguments and context may be provided at initialization or assigned later (see Schema::Field::ConnectionExtension).

+ + +
+
+
+ + +
+

Direct Known Subclasses

+

ArrayConnection, RelationConnection

+
+

Defined Under Namespace

+

+ + + + + Classes: Edge, PaginationImplementationMissingError + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(items, parent: nil, field: nil, context: nil, first: nil, after: nil, max_page_size: NOT_CONFIGURED, default_page_size: NOT_CONFIGURED, last: nil, before: nil, edge_class: nil, arguments: nil) ⇒ Connection + + + + + +

+
+

Returns a new instance of Connection.

+ + +
+
+
+

Parameters:

+
    + +
  • + + items + + + (Object) + + + + — +

    some unpaginated collection item, like an Array or ActiveRecord::Relation

    +
    + +
  • + +
  • + + context + + + (Query::Context) + + + (defaults to: nil) + + +
  • + +
  • + + parent + + + (Object) + + + (defaults to: nil) + + + — +

    The object this collection belongs to

    +
    + +
  • + +
  • + + first + + + (Integer, nil) + + + (defaults to: nil) + + + — +

    The limit parameter from the client, if it provided one

    +
    + +
  • + +
  • + + after + + + (String, nil) + + + (defaults to: nil) + + + — +

    A cursor for pagination, if the client provided one

    +
    + +
  • + +
  • + + last + + + (Integer, nil) + + + (defaults to: nil) + + + — +

    Limit parameter from the client, if provided

    +
    + +
  • + +
  • + + before + + + (String, nil) + + + (defaults to: nil) + + + — +

    A cursor for pagination, if the client provided one.

    +
    + +
  • + +
  • + + arguments + + + (Hash) + + + (defaults to: nil) + + + — +

    The arguments to the field that returned the collection wrapped by this connection

    +
    + +
  • + +
  • + + max_page_size + + + (Integer, nil) + + + (defaults to: NOT_CONFIGURED) + + + — +

    A configured value to cap the result size. Applied as first if neither first or last are given and no default_page_size is set.

    +
    + +
  • + +
  • + + default_page_size + + + (Integer, nil) + + + (defaults to: NOT_CONFIGURED) + + + — +

    A configured value to determine the result size when neither first or last are given.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+
+
# File 'lib/graphql/pagination/connection.rb', line 69
+
+def initialize(items, parent: nil, field: nil, context: nil, first: nil, after: nil, max_page_size: NOT_CONFIGURED, default_page_size: NOT_CONFIGURED, last: nil, before: nil, edge_class: nil, arguments: nil)
+  @items = items
+  @parent = parent
+  @context = context
+  @field = field
+  @first_value = first
+  @after_value = after
+  @last_value = last
+  @before_value = before
+  @arguments = arguments
+  @edge_class = edge_class || self.class::Edge
+  # This is only true if the object was _initialized_ with an override
+  # or if one is assigned later.
+  @has_max_page_size_override = max_page_size != NOT_CONFIGURED
+  @max_page_size = if max_page_size == NOT_CONFIGURED
+    nil
+  else
+    max_page_size
+  end
+  @has_default_page_size_override = default_page_size != NOT_CONFIGURED
+  @default_page_size = if default_page_size == NOT_CONFIGURED
+    nil
+  else
+    default_page_size
+  end
+  @was_authorized_by_scope_items = detect_was_authorized_by_scope_items
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #after_valueObject + + + + + +

+
+

Raw access to client-provided values. (max_page_size not applied to first or last.)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/pagination/connection.rb', line 36
+
+def after_value
+  @after_value
+end
+
+
+ + + +
+

+ + #argumentsHash<Symbol => Object> + + + + + +

+
+

Returns The field arguments from the field that returned this connection.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<Symbol => Object>) + + + + — +

    The field arguments from the field that returned this connection

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/graphql/pagination/connection.rb', line 57
+
+def arguments
+  @arguments
+end
+
+
+ + + +
+

+ + #before_valueObject + + + + + +

+
+

Raw access to client-provided values. (max_page_size not applied to first or last.)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/pagination/connection.rb', line 36
+
+def before_value
+  @before_value
+end
+
+
+ + + +
+

+ + #contextGraphQL::Query::Context + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/pagination/connection.rb', line 22
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #edge_classClass + + + + + +

+
+

Returns A wrapper class for edges of this connection.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    A wrapper class for edges of this connection

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+174
+175
+176
+
+
# File 'lib/graphql/pagination/connection.rb', line 174
+
+def edge_class
+  @edge_class
+end
+
+
+ + + +
+

+ + #fieldGraphQL::Schema::Field + + + + + +

+
+

Returns The field this connection was returned by.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+177
+178
+179
+
+
# File 'lib/graphql/pagination/connection.rb', line 177
+
+def field
+  @field
+end
+
+
+ + + +
+

+ + #firstInteger? + + + + + +

+
+

Returns A clamped first value. +(The underlying instance variable doesn’t have limits on it.) +If neither first nor last is given, but default_page_size is +present, default_page_size is used for first. If default_page_size +is greater than max_page_size, it'll be clamped down to +max_page_size. If default_page_size is nil, use max_page_size`.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer, nil) + + + + — +

    A clamped first value. +(The underlying instance variable doesn’t have limits on it.) +If neither first nor last is given, but default_page_size is +present, default_page_size is used for first. If default_page_size +is greater than max_page_size, it'll be clamped down to +max_page_size. If default_page_size is nil, use max_page_size`.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+143
+144
+145
+146
+147
+148
+149
+150
+151
+
+
# File 'lib/graphql/pagination/connection.rb', line 143
+
+def first
+  @first ||= begin
+    capped = limit_pagination_argument(@first_value, max_page_size)
+    if capped.nil? && last.nil?
+      capped = limit_pagination_argument(default_page_size, max_page_size) || max_page_size
+    end
+    capped
+  end
+end
+
+
+ + + +
+

+ + #first_valueObject + + + + + +

+
+

Raw access to client-provided values. (max_page_size not applied to first or last.)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/pagination/connection.rb', line 36
+
+def first_value
+  @first_value
+end
+
+
+ + + +
+

+ + #itemsObject (readonly) + + + + + +

+
+

Returns A list object, from the application. This is the unpaginated value passed into the connection.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    A list object, from the application. This is the unpaginated value passed into the connection.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/pagination/connection.rb', line 19
+
+def items
+  @items
+end
+
+
+ + + +
+

+ + #lastInteger? + + + + + +

+
+

Returns A clamped last value. (The underlying instance variable doesn’t have limits on it).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer, nil) + + + + — +

    A clamped last value. (The underlying instance variable doesn’t have limits on it)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+164
+165
+166
+
+
# File 'lib/graphql/pagination/connection.rb', line 164
+
+def last
+  @last ||= limit_pagination_argument(@last_value, max_page_size)
+end
+
+
+ + + +
+

+ + #last_valueObject + + + + + +

+
+

Raw access to client-provided values. (max_page_size not applied to first or last.)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/pagination/connection.rb', line 36
+
+def last_value
+  @last_value
+end
+
+
+ + + +
+

+ + #parentObject + + + + + +

+
+

Returns the object this collection belongs to.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the object this collection belongs to

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/pagination/connection.rb', line 33
+
+def parent
+  @parent
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #afterString? + + + + + +

+
+

Returns the client-provided cursor. "" is treated as nil.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + + — +

    the client-provided cursor. "" is treated as nil.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+
+
# File 'lib/graphql/pagination/connection.rb', line 48
+
+def after
+  if defined?(@after)
+    @after
+  else
+    @after = @after_value == "" ? nil : @after_value
+  end
+end
+
+
+ +
+

+ + #beforeString? + + + + + +

+
+

Returns the client-provided cursor. "" is treated as nil.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + + — +

    the client-provided cursor. "" is treated as nil.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/graphql/pagination/connection.rb', line 39
+
+def before
+  if defined?(@before)
+    @before
+  else
+    @before = @before_value == "" ? nil : @before_value
+  end
+end
+
+
+ +
+

+ + #cursor_for(item) ⇒ String + + + + + +

+
+

Return a cursor for this item.

+ + +
+
+
+

Parameters:

+
    + +
  • + + item + + + (Object) + + + + — +

    one of the passed in #items, taken from #nodes

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+218
+219
+220
+
+
# File 'lib/graphql/pagination/connection.rb', line 218
+
+def cursor_for(item)
+  raise PaginationImplementationMissingError, "Implement #{self.class}#cursor_for(item) to return the cursor for #{item.inspect}"
+end
+
+
+ +
+

+ + #default_page_sizeObject + + + + + +

+ + + + +
+
+
+
+123
+124
+125
+126
+127
+128
+129
+
+
# File 'lib/graphql/pagination/connection.rb', line 123
+
+def default_page_size
+  if @has_default_page_size_override
+    @default_page_size
+  else
+    context.schema.default_page_size
+  end
+end
+
+
+ +
+

+ + #default_page_size=(new_value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+118
+119
+120
+121
+
+
# File 'lib/graphql/pagination/connection.rb', line 118
+
+def default_page_size=(new_value)
+  @has_default_page_size_override = true
+  @default_page_size = new_value
+end
+
+
+ +
+

+ + #edge_nodesObject + + + + + +

+
+
Deprecated.

use #nodes instead

+
+

A dynamic alias for compatibility with Relay::BaseConnection.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+186
+187
+188
+
+
# File 'lib/graphql/pagination/connection.rb', line 186
+
+def edge_nodes
+  nodes
+end
+
+
+ +
+

+ + #edgesArray<Edge> + + + + + +

+
+

Returns #nodes, but wrapped with Edge instances.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Edge>) + + + + — +

    #nodes, but wrapped with Edge instances

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+169
+170
+171
+
+
# File 'lib/graphql/pagination/connection.rb', line 169
+
+def edges
+  @edges ||= nodes.map { |n| @edge_class.new(n, self) }
+end
+
+
+ +
+

+ + #end_cursorString + + + + + +

+
+

Returns The cursor of the last item in #nodes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    The cursor of the last item in #nodes

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+211
+212
+213
+
+
# File 'lib/graphql/pagination/connection.rb', line 211
+
+def end_cursor
+  nodes.last && cursor_for(nodes.last)
+end
+
+
+ +
+

+ + #has_default_page_size_override?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+131
+132
+133
+
+
# File 'lib/graphql/pagination/connection.rb', line 131
+
+def has_default_page_size_override?
+  @has_default_page_size_override
+end
+
+
+ +
+

+ + #has_max_page_size_override?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+114
+115
+116
+
+
# File 'lib/graphql/pagination/connection.rb', line 114
+
+def has_max_page_size_override?
+  @has_max_page_size_override
+end
+
+
+ +
+

+ + #has_next_pageBoolean + + + + + +

+
+

Returns True if there are more items after this page.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if there are more items after this page

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+196
+197
+198
+
+
# File 'lib/graphql/pagination/connection.rb', line 196
+
+def has_next_page
+  raise PaginationImplementationMissingError, "Implement #{self.class}#has_next_page to return the next-page check"
+end
+
+
+ +
+

+ + #has_previous_pageBoolean + + + + + +

+
+

Returns True if there were items before these items.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if there were items before these items

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+201
+202
+203
+
+
# File 'lib/graphql/pagination/connection.rb', line 201
+
+def has_previous_page
+  raise PaginationImplementationMissingError, "Implement #{self.class}#has_previous_page to return the previous-page check"
+end
+
+
+ +
+

+ + #max_page_sizeObject + + + + + +

+ + + + +
+
+
+
+106
+107
+108
+109
+110
+111
+112
+
+
# File 'lib/graphql/pagination/connection.rb', line 106
+
+def max_page_size
+  if @has_max_page_size_override
+    @max_page_size
+  else
+    context.schema.default_max_page_size
+  end
+end
+
+
+ +
+

+ + #max_page_size=(new_value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+101
+102
+103
+104
+
+
# File 'lib/graphql/pagination/connection.rb', line 101
+
+def max_page_size=(new_value)
+  @has_max_page_size_override = true
+  @max_page_size = new_value
+end
+
+
+ +
+

+ + #nodesArray<Object> + + + + + +

+
+

Returns A slice of #items, constrained by @first_value/@after_value/@last_value/@before_value.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Object>) + + + + — +

    A slice of #items, constrained by @first_value/@after_value/@last_value/@before_value

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+180
+181
+182
+
+
# File 'lib/graphql/pagination/connection.rb', line 180
+
+def nodes
+  raise PaginationImplementationMissingError, "Implement #{self.class}#nodes to paginate `@items`"
+end
+
+
+ +
+

+ + #page_infoObject + + + + + +

+
+

The connection object itself implements PageInfo fields

+ + +
+
+
+ + +
+ + + + +
+
+
+
+191
+192
+193
+
+
# File 'lib/graphql/pagination/connection.rb', line 191
+
+def page_info
+  self
+end
+
+
+ +
+

+ + #range_add_edge(item) ⇒ Edge + + + + + +

+
+

This is called by Relay::RangeAdd – it can be overridden +when item needs some modifications based on this connection’s state.

+ + +
+
+
+

Parameters:

+
    + +
  • + + item + + + (Object) + + + + — +

    An item newly added to items

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Edge) + + + +
  • + +
+ +
+ + + + +
+
+
+
+158
+159
+160
+
+
# File 'lib/graphql/pagination/connection.rb', line 158
+
+def range_add_edge(item)
+  edge_class.new(item, self)
+end
+
+
+ +
+

+ + #start_cursorString + + + + + +

+
+

Returns The cursor of the first item in #nodes.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    The cursor of the first item in #nodes

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+206
+207
+208
+
+
# File 'lib/graphql/pagination/connection.rb', line 206
+
+def start_cursor
+  nodes.first && cursor_for(nodes.first)
+end
+
+
+ +
+

+ + #was_authorized_by_scope_items?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+97
+98
+99
+
+
# File 'lib/graphql/pagination/connection.rb', line 97
+
+def was_authorized_by_scope_items?
+  @was_authorized_by_scope_items
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination/Connection/Edge.html b/api-doc/2.1.6/GraphQL/Pagination/Connection/Edge.html new file mode 100644 index 0000000000..36a669d707 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination/Connection/Edge.html @@ -0,0 +1,482 @@ + + + + + + + Class: GraphQL::Pagination::Connection::Edge + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Pagination::Connection::Edge + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/connection.rb
+
+ +
+ +

Overview

+
+

A wrapper around paginated items. It includes a #cursor for pagination +and could be extended with custom relationship-level data.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #node ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute node.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(node, connection) ⇒ Edge + + + + + +

+
+

Returns a new instance of Edge.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+261
+262
+263
+264
+
+
# File 'lib/graphql/pagination/connection.rb', line 261
+
+def initialize(node, connection)
+  @connection = connection
+  @node = node
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nodeObject (readonly) + + + + + +

+
+

Returns the value of attribute node.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+259
+260
+261
+
+
# File 'lib/graphql/pagination/connection.rb', line 259
+
+def node
+  @node
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #cursorObject + + + + + +

+ + + + +
+
+
+
+270
+271
+272
+
+
# File 'lib/graphql/pagination/connection.rb', line 270
+
+def cursor
+  @cursor ||= @connection.cursor_for(@node)
+end
+
+
+ +
+

+ + #parentObject + + + + + +

+ + + + +
+
+
+
+266
+267
+268
+
+
# File 'lib/graphql/pagination/connection.rb', line 266
+
+def parent
+  @connection.parent
+end
+
+
+ +
+

+ + #was_authorized_by_scope_items?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+274
+275
+276
+
+
# File 'lib/graphql/pagination/connection.rb', line 274
+
+def was_authorized_by_scope_items?
+  @connection.was_authorized_by_scope_items?
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination/Connection/PaginationImplementationMissingError.html b/api-doc/2.1.6/GraphQL/Pagination/Connection/PaginationImplementationMissingError.html new file mode 100644 index 0000000000..1fdabb2bcf --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination/Connection/PaginationImplementationMissingError.html @@ -0,0 +1,132 @@ + + + + + + + Exception: GraphQL::Pagination::Connection::PaginationImplementationMissingError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Pagination::Connection::PaginationImplementationMissingError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/connection.rb
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination/Connections.html b/api-doc/2.1.6/GraphQL/Pagination/Connections.html new file mode 100644 index 0000000000..f6b6c05c44 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination/Connections.html @@ -0,0 +1,683 @@ + + + + + + + Class: GraphQL::Pagination::Connections + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Pagination::Connections + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/connections.rb
+
+ +
+ +

Overview

+
+

A schema-level connection wrapper manager.

+ +

Attach as a plugin.

+ + +
+
+
+ +
+

Examples:

+ + +

Adding a custom wrapper

+

+ +
class MySchema < GraphQL::Schema
+  connections.add(MyApp::SearchResults, MyApp::SearchResultsConnection)
+end
+ + +

Removing default connection support for arrays (they can still be manually wrapped)

+

+ +
class MySchema < GraphQL::Schema
+  connections.delete(Array)
+end
+ +
+ + +

See Also:

+
    + +
  • {Schema{Schema.connections}
  • + +
+ +

Defined Under Namespace

+

+ + + + + Classes: ImplementationMissingError + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(schema:) ⇒ Connections + + + + + +

+
+

Returns a new instance of Connections.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/pagination/connections.rb', line 24
+
+def initialize(schema:)
+  @schema = schema
+  @wrappers = {}
+  add_default
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #add(nodes_class, implementation) ⇒ Object + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/pagination/connections.rb', line 30
+
+def add(nodes_class, implementation)
+  @wrappers[nodes_class] = implementation
+end
+
+
+ +
+

+ + #all_wrappersObject + + + + + +

+ + + + +
+
+
+
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'lib/graphql/pagination/connections.rb', line 38
+
+def all_wrappers
+  all_wrappers = {}
+  @schema.ancestors.reverse_each do |schema_class|
+    if schema_class.respond_to?(:connections) && (c = schema_class.connections)
+      all_wrappers.merge!(c.wrappers)
+    end
+  end
+  all_wrappers
+end
+
+
+ +
+

+ + #delete(nodes_class) ⇒ Object + + + + + +

+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'lib/graphql/pagination/connections.rb', line 34
+
+def delete(nodes_class)
+  @wrappers.delete(nodes_class)
+end
+
+
+ +
+

+ + #edge_class_for_field(field) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

use an override if there is one

+ + +
+
+
+ + +
+ + + + +
+
+
+
+88
+89
+90
+91
+92
+93
+94
+95
+96
+
+
# File 'lib/graphql/pagination/connections.rb', line 88
+
+def edge_class_for_field(field)
+  conn_type = field.type.unwrap
+  conn_type_edge_type = conn_type.respond_to?(:edge_class) && conn_type.edge_class
+  if conn_type_edge_type && conn_type_edge_type != Pagination::Connection::Edge
+    conn_type_edge_type
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #wrap(field, parent, items, arguments, context) ⇒ Object + + + + + +

+
+

Used by the runtime to wrap values in connection wrappers.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+
+
# File 'lib/graphql/pagination/connections.rb', line 61
+
+def wrap(field, parent, items, arguments, context)
+  return items if GraphQL::Execution::Interpreter::RawValue === items
+  wrappers = context ? context.namespace(:connections)[:all_wrappers] : all_wrappers
+  impl = wrapper_for(items, wrappers: wrappers)
+
+  if impl
+    impl.new(
+      items,
+      context: context,
+      parent: parent,
+      field: field,
+      max_page_size: field.has_max_page_size? ? field.max_page_size : context.schema.default_max_page_size,
+      default_page_size: field.has_default_page_size? ? field.default_page_size : context.schema.default_page_size,
+      first: arguments[:first],
+      after: arguments[:after],
+      last: arguments[:last],
+      before: arguments[:before],
+      arguments: arguments,
+      edge_class: edge_class_for_field(field),
+    )
+  else
+    raise ImplementationMissingError, "Couldn't find a connection wrapper for #{items.class} during #{field.path} (#{items.inspect})"
+  end
+end
+
+
+ +
+

+ + #wrapper_for(items, wrappers: all_wrappers) ⇒ Object + + + + + +

+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
+
# File 'lib/graphql/pagination/connections.rb', line 48
+
+def wrapper_for(items, wrappers: all_wrappers)
+  impl = nil
+
+  items.class.ancestors.each { |cls|
+    impl = wrappers[cls]
+    break if impl
+  }
+
+  impl
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination/Connections/ImplementationMissingError.html b/api-doc/2.1.6/GraphQL/Pagination/Connections/ImplementationMissingError.html new file mode 100644 index 0000000000..a780dfa6bb --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination/Connections/ImplementationMissingError.html @@ -0,0 +1,132 @@ + + + + + + + Exception: GraphQL::Pagination::Connections::ImplementationMissingError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Pagination::Connections::ImplementationMissingError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/connections.rb
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination/MongoidRelationConnection.html b/api-doc/2.1.6/GraphQL/Pagination/MongoidRelationConnection.html new file mode 100644 index 0000000000..5e274933a9 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination/MongoidRelationConnection.html @@ -0,0 +1,387 @@ + + + + + + + Class: GraphQL::Pagination::MongoidRelationConnection + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Pagination::MongoidRelationConnection + + + +

+
+ +
+
Inherits:
+
+ RelationConnection + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/mongoid_relation_connection.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Connection

+

#after_value, #arguments, #before_value, #context, #edge_class, #field, #first, #first_value, #items, #last, #last_value, #parent

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from RelationConnection

+

#cursor_for, #has_next_page, #has_previous_page, #nodes

+ + + + + + + + + +

Methods inherited from Connection

+

#after, #before, #cursor_for, #default_page_size, #default_page_size=, #edge_nodes, #edges, #end_cursor, #has_default_page_size_override?, #has_max_page_size_override?, #has_next_page, #has_previous_page, #initialize, #max_page_size, #max_page_size=, #nodes, #page_info, #range_add_edge, #start_cursor, #was_authorized_by_scope_items?

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Pagination::Connection

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #null_relation(relation) ⇒ Object + + + + + +

+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/pagination/mongoid_relation_connection.rb', line 19
+
+def null_relation(relation)
+  relation.without_options.none
+end
+
+
+ +
+

+ + #relation_count(relation) ⇒ Object + + + + + +

+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/pagination/mongoid_relation_connection.rb', line 15
+
+def relation_count(relation)
+  relation.all.count(relation.options.slice(:limit, :skip))
+end
+
+
+ +
+

+ + #relation_limit(relation) ⇒ Object + + + + + +

+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'lib/graphql/pagination/mongoid_relation_connection.rb', line 11
+
+def relation_limit(relation)
+  relation.options.limit
+end
+
+
+ +
+

+ + #relation_offset(relation) ⇒ Object + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/pagination/mongoid_relation_connection.rb', line 7
+
+def relation_offset(relation)
+  relation.options.skip
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination/RelationConnection.html b/api-doc/2.1.6/GraphQL/Pagination/RelationConnection.html new file mode 100644 index 0000000000..2463f84234 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination/RelationConnection.html @@ -0,0 +1,448 @@ + + + + + + + Class: GraphQL::Pagination::RelationConnection + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Pagination::RelationConnection + + + +

+
+ +
+
Inherits:
+
+ Connection + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/relation_connection.rb
+
+ +
+ +

Overview

+
+

A generic class for working with database query objects.

+ + +
+
+
+ + +
+ + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Connection

+

#after_value, #arguments, #before_value, #context, #edge_class, #field, #first, #first_value, #items, #last, #last_value, #parent

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Connection

+

#after, #before, #default_page_size, #default_page_size=, #edge_nodes, #edges, #end_cursor, #has_default_page_size_override?, #has_max_page_size_override?, #initialize, #max_page_size, #max_page_size=, #page_info, #range_add_edge, #start_cursor, #was_authorized_by_scope_items?

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Pagination::Connection

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #cursor_for(item) ⇒ Object + + + + + +

+ + + + +
+
+
+
+47
+48
+49
+50
+51
+52
+
+
# File 'lib/graphql/pagination/relation_connection.rb', line 47
+
+def cursor_for(item)
+  load_nodes
+  # index in nodes + existing offset + 1 (because it's offset, not index)
+  offset = nodes.index(item) + 1 + (@paged_nodes_offset || 0) - (relation_offset(items) || 0)
+  encode(offset.to_s)
+end
+
+
+ +
+

+ + #has_next_pageObject + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/graphql/pagination/relation_connection.rb', line 30
+
+def has_next_page
+  if @has_next_page.nil?
+    @has_next_page = if before_offset && before_offset > 0
+      true
+    elsif first
+      if @nodes && @nodes.count < first
+        false
+      else
+        relation_larger_than(sliced_nodes, @sliced_nodes_offset, first)
+      end
+    else
+      false
+    end
+  end
+  @has_next_page
+end
+
+
+ +
+

+ + #has_previous_pageObject + + + + + +

+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/pagination/relation_connection.rb', line 13
+
+def has_previous_page
+  if @has_previous_page.nil?
+    @has_previous_page = if after_offset && after_offset > 0
+      true
+    elsif last
+      # See whether there are any nodes _before_ the current offset.
+      # If there _is no_ current offset, then there can't be any nodes before it.
+      # Assume that if the offset is positive, there are nodes before the offset.
+      limited_nodes
+      !(@paged_nodes_offset.nil? || @paged_nodes_offset == 0)
+    else
+      false
+    end
+  end
+  @has_previous_page
+end
+
+
+ +
+

+ + #nodesObject + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+11
+
+
# File 'lib/graphql/pagination/relation_connection.rb', line 8
+
+def nodes
+  load_nodes
+  @nodes
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Pagination/SequelDatasetConnection.html b/api-doc/2.1.6/GraphQL/Pagination/SequelDatasetConnection.html new file mode 100644 index 0000000000..abf770da1c --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Pagination/SequelDatasetConnection.html @@ -0,0 +1,168 @@ + + + + + + + Class: GraphQL::Pagination::SequelDatasetConnection + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Pagination::SequelDatasetConnection + + + +

+
+ +
+
Inherits:
+
+ RelationConnection + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/pagination/sequel_dataset_connection.rb
+
+ +
+ +

Overview

+
+

Customizes RelationConnection to work with Sequel::Datasets.

+ + +
+
+
+ + +
+ + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Connection

+

#after_value, #arguments, #before_value, #context, #edge_class, #field, #first, #first_value, #items, #last, #last_value, #parent

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from RelationConnection

+

#cursor_for, #has_next_page, #has_previous_page, #nodes

+ + + + + + + + + +

Methods inherited from Connection

+

#after, #before, #cursor_for, #default_page_size, #default_page_size=, #edge_nodes, #edges, #end_cursor, #has_default_page_size_override?, #has_max_page_size_override?, #has_next_page, #has_previous_page, #initialize, #max_page_size, #max_page_size=, #nodes, #page_info, #range_add_edge, #start_cursor, #was_authorized_by_scope_items?

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Pagination::Connection

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/ParseError.html b/api-doc/2.1.6/GraphQL/ParseError.html new file mode 100644 index 0000000000..c56372883d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/ParseError.html @@ -0,0 +1,513 @@ + + + + + + + Exception: GraphQL::ParseError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::ParseError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/parse_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #col ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute col.

    +
    + +
  • + + +
  • + + + #line ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute line.

    +
    + +
  • + + +
  • + + + #query ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute query.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, line, col, query, filename: nil) ⇒ ParseError + + + + + +

+
+

Returns a new instance of ParseError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/parse_error.rb', line 5
+
+def initialize(message, line, col, query, filename: nil)
+  if filename
+    message += " (#{filename})"
+  end
+
+  super(message)
+  @line = line
+  @col = col
+  @query = query
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #colObject (readonly) + + + + + +

+
+

Returns the value of attribute col.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/graphql/parse_error.rb', line 4
+
+def col
+  @col
+end
+
+
+ + + +
+

+ + #lineObject (readonly) + + + + + +

+
+

Returns the value of attribute line.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/graphql/parse_error.rb', line 4
+
+def line
+  @line
+end
+
+
+ + + +
+

+ + #queryObject (readonly) + + + + + +

+
+

Returns the value of attribute query.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/graphql/parse_error.rb', line 4
+
+def query
+  @query
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #to_hObject + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/parse_error.rb', line 16
+
+def to_h
+  locations = line ? [{ "line" => line, "column" => col }] : []
+  {
+    "message" => message,
+    "locations" => locations,
+  }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query.html b/api-doc/2.1.6/GraphQL/Query.html new file mode 100644 index 0000000000..4468c93b78 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query.html @@ -0,0 +1,3785 @@ + + + + + + + Class: GraphQL::Query + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + +
+
Includes:
+
Tracing::Traceable
+
+ + + + + + +
+
Defined in:
+
lib/graphql/query.rb,
+ lib/graphql/query/result.rb,
lib/graphql/query/context.rb,
lib/graphql/query/variables.rb,
lib/graphql/query/fingerprint.rb,
lib/graphql/query/null_context.rb,
lib/graphql/query/validation_pipeline.rb,
lib/graphql/query/context/scoped_context.rb,
lib/graphql/query/input_validation_result.rb,
lib/graphql/query/variable_validation_error.rb
+
+
+ +
+ +

Overview

+
+

A combination of query string and Schema instance which can be reduced to a #result.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: Fingerprint + + + + Classes: Context, InputValidationResult, NullContext, OperationNameMissingError, Result, ValidationPipeline, VariableValidationError, Variables + + +

+ + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #analysis_errors ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute analysis_errors.

    +
    + +
  • + + +
  • + + + #context ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute context.

    +
    + +
  • + + +
  • + + + #logger ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute logger.

    +
    + +
  • + + +
  • + + + #multiplex ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute multiplex.

    +
    + +
  • + + +
  • + + + #operation_name ⇒ nil, String + + + + + + + + + + + + + + + + +

    The operation name provided by client or the one inferred from the document.

    +
    + +
  • + + +
  • + + + #provided_variables ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute provided_variables.

    +
    + +
  • + + +
  • + + + #query_string ⇒ Object + + + + + + + + + + + + + + + + +

    If a document was provided to GraphQL::Schema#execute instead of the raw query string, we will need to get it from the document.

    +
    + +
  • + + +
  • + + + #result_values ⇒ Object + + + + + + + + + + + + + + private + + +
    +
    + +
  • + + +
  • + + + #root_value ⇒ Object + + + + + + + + + + + + + + + + +

    The value for root types.

    +
    + +
  • + + +
  • + + + #schema ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute schema.

    +
    + +
  • + + +
  • + + + #static_validator ⇒ GraphQL::StaticValidation::Validator + + + + + + + + + + + + + + + + +

    If present, the query will validate with these rules.

    +
    + +
  • + + +
  • + + + #subscription_topic ⇒ String? + + + + + + + + + readonly + + + + + + + + + +

    The triggered event, if this query is a subscription update.

    +
    + +
  • + + +
  • + + + #tracers ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute tracers.

    +
    + +
  • + + +
  • + + + #validate ⇒ Boolean + + + + + + + + + + + + + + + + +

    If false, static validation is skipped (execution behavior for invalid queries is undefined).

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + +

Methods included from Tracing::Traceable

+

#trace

+
+

Constructor Details

+ +
+

+ + #initialize(schema, query_string = nil, query: nil, document: nil, context: nil, variables: nil, validate: true, static_validator: nil, subscription_topic: nil, operation_name: nil, root_value: nil, max_depth: schema.max_depth, max_complexity: schema.max_complexity, warden: nil) ⇒ Query + + + + + +

+
+

Prepare query query_string on schema

+ + +
+
+
+

Parameters:

+
    + +
  • + + schema + + + (GraphQL::Schema) + + + +
  • + +
  • + + query_string + + + (String) + + + (defaults to: nil) + + +
  • + +
  • + + context + + + (#[]) + + + (defaults to: nil) + + + — +

    an arbitrary hash of values which you can access in Field#resolve

    +
    + +
  • + +
  • + + variables + + + (Hash) + + + (defaults to: nil) + + + — +

    values for $variables in the query

    +
    + +
  • + +
  • + + operation_name + + + (String) + + + (defaults to: nil) + + + — +

    if the query string contains many operations, this is the one which should be executed

    +
    + +
  • + +
  • + + root_value + + + (Object) + + + (defaults to: nil) + + + — +

    the object used to resolve fields on the root type

    +
    + +
  • + +
  • + + max_depth + + + (Numeric) + + + (defaults to: schema.max_depth) + + + — +

    the maximum number of nested selections allowed for this query (falls back to schema-level value)

    +
    + +
  • + +
  • + + max_complexity + + + (Numeric) + + + (defaults to: schema.max_complexity) + + + — +

    the maximum field complexity for this query (falls back to schema-level value)

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+
+
# File 'lib/graphql/query.rb', line 98
+
+def initialize(schema, query_string = nil, query: nil, document: nil, context: nil, variables: nil, validate: true, static_validator: nil, subscription_topic: nil, operation_name: nil, root_value: nil, max_depth: schema.max_depth, max_complexity: schema.max_complexity, warden: nil)
+  # Even if `variables: nil` is passed, use an empty hash for simpler logic
+  variables ||= {}
+  @schema = schema
+  @context = schema.context_class.new(query: self, object: root_value, values: context)
+  @warden = warden
+  @subscription_topic = subscription_topic
+  @root_value = root_value
+  @fragments = nil
+  @operations = nil
+  @validate = validate
+  self.static_validator = static_validator if static_validator
+  context_tracers = (context ? context.fetch(:tracers, []) : [])
+  @tracers = schema.tracers + context_tracers
+
+  # Support `ctx[:backtrace] = true` for wrapping backtraces
+  if context && context[:backtrace] && !@tracers.include?(GraphQL::Backtrace::Tracer)
+    if schema.trace_class <= GraphQL::Tracing::CallLegacyTracers
+      context_tracers += [GraphQL::Backtrace::Tracer]
+      @tracers << GraphQL::Backtrace::Tracer
+    elsif !(current_trace.class <= GraphQL::Backtrace::Trace)
+      raise "Invariant: `backtrace: true` should have provided a trace class with Backtrace mixed in, but it didnt. (Found: #{current_trace.class.ancestors}). This is a bug in GraphQL-Ruby, please report it on GitHub."
+    end
+  end
+
+  if context_tracers.any? && !(schema.trace_class <= GraphQL::Tracing::CallLegacyTracers)
+    raise ArgumentError, "context[:tracers] are not supported without `trace_with(GraphQL::Tracing::CallLegacyTracers)` in the schema configuration, please add it."
+  end
+
+  @analysis_errors = []
+  if variables.is_a?(String)
+    raise ArgumentError, "Query variables should be a Hash, not a String. Try JSON.parse to prepare variables."
+  else
+    @provided_variables = variables || {}
+  end
+
+  @query_string = query_string || query
+  @document = document
+
+  if @query_string && @document
+    raise ArgumentError, "Query should only be provided a query string or a document, not both."
+  end
+
+  if @query_string && !@query_string.is_a?(String)
+    raise ArgumentError, "Query string argument should be a String, got #{@query_string.class.name} instead."
+  end
+
+  # A two-layer cache of type resolution:
+  # { abstract_type => { value => resolved_type } }
+  @resolved_types_cache = Hash.new do |h1, k1|
+    h1[k1] = Hash.new do |h2, k2|
+      h2[k2] = @schema.resolve_type(k1, k2, @context)
+    end
+  end
+
+  # Trying to execute a document
+  # with no operations returns an empty hash
+  @ast_variables = []
+  @mutation = false
+  @operation_name = operation_name
+  @prepared_ast = false
+  @validation_pipeline = nil
+  @max_depth = max_depth
+  @max_complexity = max_complexity
+
+  @result_values = nil
+  @executed = false
+
+  @logger = if context && context[:logger] == false
+    Logger.new(IO::NULL)
+  elsif context && (l = context[:logger])
+    l
+  else
+    schema.default_logger
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #analysis_errorsObject + + + + + +

+
+

Returns the value of attribute analysis_errors.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+324
+325
+326
+
+
# File 'lib/graphql/query.rb', line 324
+
+def analysis_errors
+  @analysis_errors
+end
+
+
+ + + +
+

+ + #contextObject (readonly) + + + + + +

+
+

Returns the value of attribute context.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/query.rb', line 28
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #loggerObject (readonly) + + + + + +

+
+

Returns the value of attribute logger.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+380
+381
+382
+
+
# File 'lib/graphql/query.rb', line 380
+
+def logger
+  @logger
+end
+
+
+ + + +
+

+ + #multiplexObject + + + + + +

+
+

Returns the value of attribute multiplex.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+184
+185
+186
+
+
# File 'lib/graphql/query.rb', line 184
+
+def multiplex
+  @multiplex
+end
+
+
+ + + +
+

+ + #operation_namenil, String + + + + + +

+
+

Returns The operation name provided by client or the one inferred from the document. Used to determine which operation to run.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (nil, String) + + + + — +

    The operation name provided by client or the one inferred from the document. Used to determine which operation to run.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'lib/graphql/query.rb', line 34
+
+def operation_name
+  @operation_name
+end
+
+
+ + + +
+

+ + #provided_variablesObject (readonly) + + + + + +

+
+

Returns the value of attribute provided_variables.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/query.rb', line 28
+
+def provided_variables
+  @provided_variables
+end
+
+
+ + + +
+

+ + #query_stringObject + + + + + +

+
+

If a document was provided to GraphQL::Schema#execute instead of the raw query string, we will need to get it from the document

+ + +
+
+
+ + +
+ + + + +
+
+
+
+176
+177
+178
+
+
# File 'lib/graphql/query.rb', line 176
+
+def query_string
+  @query_string ||= (document ? document.to_query_string : nil)
+end
+
+
+ + + +
+

+ + #result_valuesObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+216
+217
+218
+
+
# File 'lib/graphql/query.rb', line 216
+
+def result_values
+  @result_values
+end
+
+
+ + + +
+

+ + #root_valueObject + + + + + +

+
+

The value for root types

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'lib/graphql/query.rb', line 31
+
+def root_value
+  @root_value
+end
+
+
+ + + +
+

+ + #schemaObject (readonly) + + + + + +

+
+

Returns the value of attribute schema.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/query.rb', line 28
+
+def schema
+  @schema
+end
+
+
+ + + +
+

+ + #static_validatorGraphQL::StaticValidation::Validator + + + + + +

+
+

Returns if present, the query will validate with these rules.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+49
+50
+51
+
+
# File 'lib/graphql/query.rb', line 49
+
+def static_validator
+  @static_validator
+end
+
+
+ + + +
+

+ + #subscription_topicString? (readonly) + + + + + +

+
+

Returns the triggered event, if this query is a subscription update.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + + — +

    the triggered event, if this query is a subscription update

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+85
+86
+87
+
+
# File 'lib/graphql/query.rb', line 85
+
+def subscription_topic
+  @subscription_topic
+end
+
+
+ + + +
+

+ + #tracersObject (readonly) + + + + + +

+
+

Returns the value of attribute tracers.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+87
+88
+89
+
+
# File 'lib/graphql/query.rb', line 87
+
+def tracers
+  @tracers
+end
+
+
+ + + +
+

+ + #validateBoolean + + + + + +

+
+

Returns if false, static validation is skipped (execution behavior for invalid queries is undefined).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    if false, static validation is skipped (execution behavior for invalid queries is undefined)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'lib/graphql/query.rb', line 37
+
+def validate
+  @validate
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #after_lazy(value, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+
+
# File 'lib/graphql/query.rb', line 368
+
+def after_lazy(value, &block)
+  if !defined?(@runtime_instance)
+    @runtime_instance = context.namespace(:interpreter_runtime)[:runtime]
+  end
+
+  if @runtime_instance
+    @runtime_instance.minimal_after_lazy(value, &block)
+  else
+    @schema.after_lazy(value, &block)
+  end
+end
+
+
+ +
+

+ + #arguments_cacheObject + + + + + +

+ + + + +
+
+
+
+277
+278
+279
+
+
# File 'lib/graphql/query.rb', line 277
+
+def arguments_cache
+  @arguments_cache ||= Execution::Interpreter::ArgumentsCache.new(self)
+end
+
+
+ +
+

+ + #arguments_for(ast_node, definition, parent_object: nil) ⇒ Object + + + + + +

+
+

Node-level cache for calculating arguments. Used during execution and query analysis.

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+273
+274
+275
+
+
# File 'lib/graphql/query.rb', line 273
+
+def arguments_for(ast_node, definition, parent_object: nil)
+  arguments_cache.fetch(ast_node, definition, parent_object)
+end
+
+
+ +
+

+ + #current_traceGraphQL::Tracing::Trace + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+187
+188
+189
+
+
# File 'lib/graphql/query.rb', line 187
+
+def current_trace
+  @current_trace ||= context[:trace] || (multiplex ? multiplex.current_trace : schema.new_trace(multiplex: multiplex, query: self))
+end
+
+
+ +
+

+ + #documentGraphQL::Language::Nodes::Document + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+65
+66
+67
+68
+69
+70
+71
+72
+
+
# File 'lib/graphql/query.rb', line 65
+
+def document
+  # It's ok if this hasn't been assigned yet
+  if @query_string || @document
+    with_prepared_ast { @document }
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #executed?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+235
+236
+237
+
+
# File 'lib/graphql/query.rb', line 235
+
+def executed?
+  @executed
+end
+
+
+ +
+

+ + #fingerprintString + + + + + +

+
+

This contains a few components:

+ +
    +
  • The selected operation name (or anonymous)
  • +
  • The fingerprint of the query string
  • +
  • The number of given variables (for readability)
  • +
  • The fingerprint of the given variables
  • +
+ +

This fingerprint can be used to track runs of the same operation-variables combination over time.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    An opaque hash identifying this operation-variables combination

    +
    + +
  • + +
+ +

See Also:

+ + +
+ + + + +
+
+
+
+303
+304
+305
+
+
# File 'lib/graphql/query.rb', line 303
+
+def fingerprint
+  @fingerprint ||= "#{operation_fingerprint}/#{variables_fingerprint}"
+end
+
+
+ +
+

+ + #fragmentsObject + + + + + +

+ + + + +
+
+
+
+218
+219
+220
+
+
# File 'lib/graphql/query.rb', line 218
+
+def fragments
+  with_prepared_ast { @fragments }
+end
+
+
+ +
+

+ + #handle_or_reraise(err) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+364
+365
+366
+
+
# File 'lib/graphql/query.rb', line 364
+
+def handle_or_reraise(err)
+  schema.handle_or_reraise(context, err)
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+74
+75
+76
+
+
# File 'lib/graphql/query.rb', line 74
+
+def inspect
+  "query ..."
+end
+
+
+ +
+

+ + #interpreter?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+180
+181
+182
+
+
# File 'lib/graphql/query.rb', line 180
+
+def interpreter?
+  true
+end
+
+
+ +
+

+ + #lookaheadGraphQL::Execution::Lookahead + + + + + +

+
+

A lookahead for the root selections of this query

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+197
+198
+199
+200
+201
+202
+203
+
+
# File 'lib/graphql/query.rb', line 197
+
+def lookahead
+  @lookahead ||= begin
+    ast_node = selected_operation
+    root_type = warden.root_type_for_operation(ast_node.operation_type || "query")
+    GraphQL::Execution::Lookahead.new(query: self, root_type: root_type, ast_nodes: [ast_node])
+  end
+end
+
+
+ +
+

+ + #mutation?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+351
+352
+353
+
+
# File 'lib/graphql/query.rb', line 351
+
+def mutation?
+  with_prepared_ast { @mutation }
+end
+
+
+ +
+

+ + #operation_fingerprintString + + + + + +

+
+

Returns An opaque hash for identifying this query’s given query string and selected operation.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    An opaque hash for identifying this query’s given query string and selected operation

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+308
+309
+310
+
+
# File 'lib/graphql/query.rb', line 308
+
+def operation_fingerprint
+  @operation_fingerprint ||= "#{selected_operation_name || "anonymous"}/#{Fingerprint.generate(query_string)}"
+end
+
+
+ +
+

+ + #operationsObject + + + + + +

+ + + + +
+
+
+
+222
+223
+224
+
+
# File 'lib/graphql/query.rb', line 222
+
+def operations
+  with_prepared_ast { @operations }
+end
+
+
+ +
+

+ + #query?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+355
+356
+357
+
+
# File 'lib/graphql/query.rb', line 355
+
+def query?
+  with_prepared_ast { @query }
+end
+
+
+ +
+

+ + #resolve_type(abstract_type, value = NOT_CONFIGURED) ⇒ GraphQL::ObjectType? + + + + + +

+
+

Returns The runtime type of value from Schema.resolve_type.

+ + +
+
+
+

Parameters:

+
    + +
  • + + abstract_type + + + (GraphQL::UnionType, GraphQL::InterfaceType) + + + +
  • + +
  • + + value + + + (Object) + + + (defaults to: NOT_CONFIGURED) + + + — +

    Any runtime value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (GraphQL::ObjectType, nil) + + + + — +

    The runtime type of value from Schema.resolve_type

    +
    + +
  • + +
+ +

See Also:

+
    + +
  • to apply filtering from `only` / `except`
  • + +
+ +
+ + + + +
+
+
+
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+
+
# File 'lib/graphql/query.rb', line 339
+
+def resolve_type(abstract_type, value = NOT_CONFIGURED)
+  if value.is_a?(Symbol) && value == NOT_CONFIGURED
+    # Old method signature
+    value = abstract_type
+    abstract_type = nil
+  end
+  if value.is_a?(GraphQL::Schema::Object)
+    value = value.object
+  end
+  @resolved_types_cache[abstract_type][value]
+end
+
+
+ +
+

+ + #resultHash + + + + + +

+
+

Get the result for this query, executing it once

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    A GraphQL response, with "data" and/or "errors" keys

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+228
+229
+230
+231
+232
+233
+
+
# File 'lib/graphql/query.rb', line 228
+
+def result
+  if !@executed
+    Execution::Interpreter.run_all(@schema, [self], context: @context)
+  end
+  @result ||= Query::Result.new(query: self, values: @result_values)
+end
+
+
+ +
+

+ + #sanitized_query_string(inline_variables: true) ⇒ String? + + + + + +

+
+

A version of the given query string, with: +- Variables inlined to the query +- Strings replaced with <REDACTED>

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + + — +

    Returns nil if the query is invalid.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+285
+286
+287
+288
+289
+
+
# File 'lib/graphql/query.rb', line 285
+
+def sanitized_query_string(inline_variables: true)
+  with_prepared_ast {
+    schema.sanitized_printer.new(self, inline_variables: inline_variables).sanitized_query_string
+  }
+end
+
+
+ +
+

+ + #selected_operationGraphQL::Language::Nodes::OperationDefinition? + + + + + +

+
+

This is the operation to run for this query. +If more than one operation is present, it must be named at runtime.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+246
+247
+248
+
+
# File 'lib/graphql/query.rb', line 246
+
+def selected_operation
+  with_prepared_ast { @selected_operation }
+end
+
+
+ +
+

+ + #selected_operation_nameString? + + + + + +

+
+

Returns The name of the operation to run (may be inferred).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + + — +

    The name of the operation to run (may be inferred)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+79
+80
+81
+82
+
+
# File 'lib/graphql/query.rb', line 79
+
+def selected_operation_name
+  return nil unless selected_operation
+  selected_operation.name
+end
+
+
+ +
+

+ + #static_errorsObject + + + + + +

+ + + + +
+
+
+
+239
+240
+241
+
+
# File 'lib/graphql/query.rb', line 239
+
+def static_errors
+  validation_errors + analysis_errors + context.errors
+end
+
+
+ +
+

+ + #subscription?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+359
+360
+361
+
+
# File 'lib/graphql/query.rb', line 359
+
+def subscription?
+  with_prepared_ast { @subscription }
+end
+
+
+ +
+

+ + #subscription_update?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+191
+192
+193
+
+
# File 'lib/graphql/query.rb', line 191
+
+def subscription_update?
+  @subscription_topic && subscription?
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+325
+326
+327
+
+
# File 'lib/graphql/query.rb', line 325
+
+def valid?
+  validation_pipeline.valid? && analysis_errors.empty?
+end
+
+
+ +
+

+ + #validation_pipelineObject + + + + + +

+ + + + +
+
+
+
+317
+318
+319
+
+
# File 'lib/graphql/query.rb', line 317
+
+def validation_pipeline
+  with_prepared_ast { @validation_pipeline }
+end
+
+
+ +
+

+ + #variablesGraphQL::Query::Variables + + + + + +

+
+

Determine the values for variables of this query, using default values +if a value isn’t provided at runtime.

+ +

If some variable is invalid, errors are added to #validation_errors.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+
+
# File 'lib/graphql/query.rb', line 256
+
+def variables
+  @variables ||= begin
+    with_prepared_ast {
+      GraphQL::Query::Variables.new(
+        @context,
+        @ast_variables,
+        @provided_variables,
+      )
+    }
+  end
+end
+
+
+ +
+

+ + #variables_fingerprintString + + + + + +

+
+

Returns An opaque hash for identifying this query’s given a variable values (not including defaults).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    An opaque hash for identifying this query’s given a variable values (not including defaults)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+313
+314
+315
+
+
# File 'lib/graphql/query.rb', line 313
+
+def variables_fingerprint
+  @variables_fingerprint ||= "#{provided_variables.size}/#{Fingerprint.generate(provided_variables.to_json)}"
+end
+
+
+ +
+

+ + #wardenObject + + + + + +

+ + + + +
+
+
+
+329
+330
+331
+
+
# File 'lib/graphql/query.rb', line 329
+
+def warden
+  with_prepared_ast { @warden }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/Context.html b/api-doc/2.1.6/GraphQL/Query/Context.html new file mode 100644 index 0000000000..4e78de8285 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/Context.html @@ -0,0 +1,2207 @@ + + + + + + + Class: GraphQL::Query::Context + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::Context + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + +
+
Includes:
+
SharedMethods
+
+ + + + + + +
+
Defined in:
+
lib/graphql/query/context.rb,
+ lib/graphql/query/context/scoped_context.rb
+
+
+ +
+ +

Overview

+
+

Expose some query-specific info to field resolve functions. +It delegates [] to the hash that’s passed to GraphQL::Query#initialize.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: SharedMethods + + + + Classes: ExecutionErrors, Scoped, ScopedContext + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
RUNTIME_METADATA_KEYS = + +
+
Set.new([:current_object, :current_arguments, :current_field, :current_path])
+ +
UNSPECIFIED_FETCH_DEFAULT = + +
+
Object.new
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + +

Methods included from SharedMethods

+

#add_error, #backtrace, #execution_errors, #skip

+
+

Constructor Details

+ +
+

+ + #initialize(query:, schema: query.schema, values:, object:) ⇒ Context + + + + + +

+
+

Make a new context which delegates key lookup to values

+ + +
+
+
+

Parameters:

+
    + +
  • + + query + + + (GraphQL::Query) + + + + — +

    the query who owns this context

    +
    + +
  • + +
  • + + values + + + (Hash) + + + + — +

    A hash of arbitrary values which will be accessible at query-time

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+
+
# File 'lib/graphql/query/context.rb', line 80
+
+def initialize(query:, schema: query.schema, values:, object:)
+  @query = query
+  @schema = schema
+  @provided_values = values || {}
+  @object = object
+  # Namespaced storage, where user-provided values are in `nil` namespace:
+  @storage = Hash.new { |h, k| h[k] = {} }
+  @storage[nil] = @provided_values
+  @errors = []
+  @path = []
+  @value = nil
+  @context = self # for SharedMethods TODO delete sharedmethods
+  @scoped_context = ScopedContext.new(self)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #errorsArray<GraphQL::ExecutionError> (readonly) + + + + + +

+
+

Returns errors returned during execution.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+66
+67
+68
+
+
# File 'lib/graphql/query/context.rb', line 66
+
+def errors
+  @errors
+end
+
+
+ + + +
+

+ + #interpreter=(value) ⇒ Object (writeonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+105
+106
+107
+
+
# File 'lib/graphql/query/context.rb', line 105
+
+def interpreter=(value)
+  @interpreter = value
+end
+
+
+ + + +
+

+ + #pathArray<String, Integer> (readonly) + + + + + +

+
+

Returns The current position in the result.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<String, Integer>) + + + + — +

    The current position in the result

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+75
+76
+77
+
+
# File 'lib/graphql/query/context.rb', line 75
+
+def path
+  @path
+end
+
+
+ + + +
+

+ + #queryGraphQL::Query (readonly) + + + + + +

+
+

Returns The query whose context this is.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Query) + + + + — +

    The query whose context this is

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/graphql/query/context.rb', line 69
+
+def query
+  @query
+end
+
+
+ + + +
+

+ + #schemaGraphQL::Schema (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+72
+73
+74
+
+
# File 'lib/graphql/query/context.rb', line 72
+
+def schema
+  @schema
+end
+
+
+ + + +
+

+ + #scoped_contextObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+111
+112
+113
+
+
# File 'lib/graphql/query/context.rb', line 111
+
+def scoped_context
+  @scoped_context
+end
+
+
+ + + +
+

+ + #value=(value) ⇒ Object (writeonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+108
+109
+110
+
+
# File 'lib/graphql/query/context.rb', line 108
+
+def value=(value)
+  @value = value
+end
+
+
+ + + +
+

+ + #wardenGraphQL::Schema::Warden + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+217
+218
+219
+
+
# File 'lib/graphql/query/context.rb', line 217
+
+def warden
+  @warden ||= (@query && @query.warden)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #[](key) ⇒ Object + + + + + +

+
+

Lookup key from the hash passed to Schema#execute as context:

+ + +
+
+
+ + +
+ + + + +
+
+
+
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+
+
# File 'lib/graphql/query/context.rb', line 124
+
+def [](key)
+  if @scoped_context.key?(key)
+    @scoped_context[key]
+  elsif @provided_values.key?(key)
+    @provided_values[key]
+  elsif RUNTIME_METADATA_KEYS.include?(key)
+    if key == :current_path
+      current_path
+    else
+      (current_runtime_state = Thread.current[:__graphql_runtime_info]) &&
+        (query_runtime_state = current_runtime_state[@query]) &&
+        (query_runtime_state.public_send(key))
+    end
+  else
+    # not found
+    nil
+  end
+end
+
+
+ +
+

+ + #[]=(key, value) ⇒ Object + + + + + +

+
+

Reassign key to the hash passed to Schema#execute as context:

+ + +
+
+
+ + +
+ + + + +
+
+
+
+120
+121
+122
+
+
# File 'lib/graphql/query/context.rb', line 120
+
+def []=(key, value)
+  @provided_values[key] = value
+end
+
+
+ +
+

+ + #current_pathObject + + + + + +

+ + + + +
+
+
+
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+
+
# File 'lib/graphql/query/context.rb', line 143
+
+def current_path
+  current_runtime_state = Thread.current[:__graphql_runtime_info]
+  query_runtime_state = current_runtime_state && current_runtime_state[@query]
+
+  path = query_runtime_state &&
+    (result = query_runtime_state.current_result) &&
+    (result.path)
+  if path && (rn = query_runtime_state.current_result_name)
+    path = path.dup
+    path.push(rn)
+  end
+  path
+end
+
+
+ +
+

+ + #dataloaderObject + + + + + +

+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'lib/graphql/query/context.rb', line 100
+
+def dataloader
+  @dataloader ||= self[:dataloader] || (query.multiplex ? query.multiplex.dataloader : schema.dataloader_class.new)
+end
+
+
+ +
+

+ + #delete(key) ⇒ Object + + + + + +

+ + + + +
+
+
+
+157
+158
+159
+160
+161
+162
+163
+
+
# File 'lib/graphql/query/context.rb', line 157
+
+def delete(key)
+  if @scoped_context.key?(key)
+    @scoped_context.delete(key)
+  else
+    @provided_values.delete(key)
+  end
+end
+
+
+ +
+

+ + #dig(key, *other_keys) ⇒ Object + + + + + +

+ + + + +
+
+
+
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'lib/graphql/query/context.rb', line 185
+
+def dig(key, *other_keys)
+  if RUNTIME_METADATA_KEYS.include?(key)
+    (current_runtime_state = Thread.current[:__graphql_runtime_info]) &&
+      (query_runtime_state = current_runtime_state[@query]) &&
+      (obj = query_runtime_state.public_send(key)) &&
+      if other_keys.empty?
+        obj
+      else
+        obj.dig(*other_keys)
+      end
+  elsif @scoped_context.key?(key)
+    @scoped_context.dig(key, *other_keys)
+  else
+    @provided_values.dig(key, *other_keys)
+  end
+end
+
+
+ +
+

+ + #fetch(key, default = UNSPECIFIED_FETCH_DEFAULT) ⇒ Object + + + + + +

+ + + + +
+
+
+
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+
+
# File 'lib/graphql/query/context.rb', line 167
+
+def fetch(key, default = UNSPECIFIED_FETCH_DEFAULT)
+  if RUNTIME_METADATA_KEYS.include?(key)
+    (runtime = Thread.current[:__graphql_runtime_info]) &&
+      (query_runtime_state = runtime[@query]) &&
+      (query_runtime_state.public_send(key))
+  elsif @scoped_context.key?(key)
+    scoped_context[key]
+  elsif @provided_values.key?(key)
+    @provided_values[key]
+  elsif default != UNSPECIFIED_FETCH_DEFAULT
+    default
+  elsif block_given?
+    yield(self, key)
+  else
+    raise KeyError.new(key: key)
+  end
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+244
+245
+246
+
+
# File 'lib/graphql/query/context.rb', line 244
+
+def inspect
+  "#<Query::Context ...>"
+end
+
+
+ +
+

+ + #key?(key) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+212
+213
+214
+
+
# File 'lib/graphql/query/context.rb', line 212
+
+def key?(key)
+  @scoped_context.key?(key) || @provided_values.key?(key)
+end
+
+
+ +
+

+ + #loggerObject + + + + + +

+ + + + +
+
+
+
+240
+241
+242
+
+
# File 'lib/graphql/query/context.rb', line 240
+
+def logger
+  @query && @query.logger
+end
+
+
+ +
+

+ + #namespace(ns) ⇒ Hash + + + + + +

+
+

Get an isolated hash for ns. Doesn’t affect user-provided storage.

+ + +
+
+
+

Parameters:

+
    + +
  • + + ns + + + (Object) + + + + — +

    a usage-specific namespace identifier

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    namespaced storage

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+227
+228
+229
+230
+231
+232
+233
+
+
# File 'lib/graphql/query/context.rb', line 227
+
+def namespace(ns)
+  if ns == :interpreter
+    self
+  else
+    @storage[ns]
+  end
+end
+
+
+ +
+

+ + #namespace?(ns) ⇒ Boolean + + + + + +

+
+

Returns true if this namespace was accessed before.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    true if this namespace was accessed before

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+236
+237
+238
+
+
# File 'lib/graphql/query/context.rb', line 236
+
+def namespace?(ns)
+  @storage.key?(ns)
+end
+
+
+ +
+

+ + #response_extensionsHash + + + + + +

+
+

Returns A hash that will be added verbatim to the result hash, as "extensions" => { ... }.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    A hash that will be added verbatim to the result hash, as "extensions" => { ... }

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+96
+97
+98
+
+
# File 'lib/graphql/query/context.rb', line 96
+
+def response_extensions
+  namespace(:__query_result_extensions__)
+end
+
+
+ +
+

+ + #scopedContext::Scoped + + + + + +

+
+

Use this when you need to do a scoped set inside a lazy-loaded (or batch-loaded) +block of code.

+ + +
+
+
+ +
+

Examples:

+ + +

using scoped context inside a promise

+

+ +
scoped_ctx = context.scoped
+SomeBatchLoader.load(...).then do |thing|
+  # use a scoped_ctx which was created _before_ dataloading:
+  scoped_ctx.set!(:thing, thing)
+end
+ +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+267
+268
+269
+
+
# File 'lib/graphql/query/context.rb', line 267
+
+def scoped
+  Scoped.new(@scoped_context, current_path)
+end
+
+
+ +
+

+ + #scoped_merge!(hash) ⇒ Object + + + + + +

+ + + + +
+
+
+
+248
+249
+250
+
+
# File 'lib/graphql/query/context.rb', line 248
+
+def scoped_merge!(hash)
+  @scoped_context.merge!(hash)
+end
+
+
+ +
+

+ + #scoped_set!(key, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+252
+253
+254
+255
+
+
# File 'lib/graphql/query/context.rb', line 252
+
+def scoped_set!(key, value)
+  scoped_merge!(key => value)
+  nil
+end
+
+
+ +
+

+ + #to_hObject + + + + Also known as: + to_hash + + + + +

+ + + + +
+
+
+
+202
+203
+204
+205
+206
+207
+208
+
+
# File 'lib/graphql/query/context.rb', line 202
+
+def to_h
+  if (current_scoped_context = @scoped_context.merged_context)
+    @provided_values.merge(current_scoped_context)
+  else
+    @provided_values
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/Context/ExecutionErrors.html b/api-doc/2.1.6/GraphQL/Query/Context/ExecutionErrors.html new file mode 100644 index 0000000000..07613c9713 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/Context/ExecutionErrors.html @@ -0,0 +1,284 @@ + + + + + + + Class: GraphQL::Query::Context::ExecutionErrors + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::Context::ExecutionErrors + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/query/context.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(ctx) ⇒ ExecutionErrors + + + + + +

+
+

Returns a new instance of ExecutionErrors.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'lib/graphql/query/context.rb', line 41
+
+def initialize(ctx)
+  @context = ctx
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #add(err_or_msg) ⇒ Object + + + + Also known as: + >>, push + + + + +

+ + + + +
+
+
+
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+
+
# File 'lib/graphql/query/context.rb', line 45
+
+def add(err_or_msg)
+  err = case err_or_msg
+  when String
+    GraphQL::ExecutionError.new(err_or_msg)
+  when GraphQL::ExecutionError
+    err_or_msg
+  else
+    raise ArgumentError, "expected String or GraphQL::ExecutionError, not #{err_or_msg.class} (#{err_or_msg.inspect})"
+  end
+  # This will assign ast_node and path
+  @context.add_error(err)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/Context/Scoped.html b/api-doc/2.1.6/GraphQL/Query/Context/Scoped.html new file mode 100644 index 0000000000..11a89e6e0d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/Context/Scoped.html @@ -0,0 +1,317 @@ + + + + + + + Class: GraphQL::Query::Context::Scoped + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::Context::Scoped + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/query/context.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(scoped_context, path) ⇒ Scoped + + + + + +

+
+

Returns a new instance of Scoped.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+272
+273
+274
+275
+
+
# File 'lib/graphql/query/context.rb', line 272
+
+def initialize(scoped_context, path)
+  @path = path
+  @scoped_context = scoped_context
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #merge!(hash) ⇒ Object + + + + + +

+ + + + +
+
+
+
+277
+278
+279
+
+
# File 'lib/graphql/query/context.rb', line 277
+
+def merge!(hash)
+  @scoped_context.merge!(hash, at: @path)
+end
+
+
+ +
+

+ + #set!(key, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+281
+282
+283
+284
+
+
# File 'lib/graphql/query/context.rb', line 281
+
+def set!(key, value)
+  @scoped_context.merge!({ key => value }, at: @path)
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/Context/ScopedContext.html b/api-doc/2.1.6/GraphQL/Query/Context/ScopedContext.html new file mode 100644 index 0000000000..a5951bf69e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/Context/ScopedContext.html @@ -0,0 +1,626 @@ + + + + + + + Class: GraphQL::Query::Context::ScopedContext + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::Context::ScopedContext + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/query/context/scoped_context.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(query_context) ⇒ ScopedContext + + + + + +

+
+

Returns a new instance of ScopedContext.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+9
+10
+
+
# File 'lib/graphql/query/context/scoped_context.rb', line 6
+
+def initialize(query_context)
+  @query_context = query_context
+  @scoped_contexts = nil
+  @all_keys = nil
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #[](key) ⇒ Object + + + + + +

+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+
+
# File 'lib/graphql/query/context/scoped_context.rb', line 46
+
+def [](key)
+  each_present_path_ctx do |path_ctx|
+    if path_ctx.key?(key)
+      return path_ctx[key]
+    end
+  end
+  nil
+end
+
+
+ +
+

+ + #current_pathObject + + + + + +

+ + + + +
+
+
+
+55
+56
+57
+
+
# File 'lib/graphql/query/context/scoped_context.rb', line 55
+
+def current_path
+  @query_context.current_path || GraphQL::EmptyObjects::EMPTY_ARRAY
+end
+
+
+ +
+

+ + #dig(key, *other_keys) ⇒ Object + + + + + +

+ + + + +
+
+
+
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
+
# File 'lib/graphql/query/context/scoped_context.rb', line 59
+
+def dig(key, *other_keys)
+  each_present_path_ctx do |path_ctx|
+    if path_ctx.key?(key)
+      found_value = path_ctx[key]
+      if other_keys.any?
+        return found_value.dig(*other_keys)
+      else
+        return found_value
+      end
+    end
+  end
+  nil
+end
+
+
+ +
+

+ + #key?(key) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
+
# File 'lib/graphql/query/context/scoped_context.rb', line 35
+
+def key?(key)
+  if @all_keys && @all_keys.include?(key)
+    each_present_path_ctx do |path_ctx|
+      if path_ctx.key?(key)
+        return true
+      end
+    end
+  end
+  false
+end
+
+
+ +
+

+ + #merge!(hash, at: current_path) ⇒ Object + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
+
# File 'lib/graphql/query/context/scoped_context.rb', line 24
+
+def merge!(hash, at: current_path)
+  @all_keys ||= Set.new
+  @all_keys.merge(hash.keys)
+  ctx = @scoped_contexts ||= {}
+  at.each do |path_part|
+    ctx = ctx[path_part] ||= { parent: ctx }
+  end
+  this_scoped_ctx = ctx[:scoped_context] ||= {}
+  this_scoped_ctx.merge!(hash)
+end
+
+
+ +
+

+ + #merged_contextObject + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/query/context/scoped_context.rb', line 12
+
+def merged_context
+  if @scoped_contexts.nil?
+    GraphQL::EmptyObjects::EMPTY_HASH
+  else
+    merged_ctx = {}
+    each_present_path_ctx do |path_ctx|
+      merged_ctx = path_ctx.merge(merged_ctx)
+    end
+    merged_ctx
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/Context/SharedMethods.html b/api-doc/2.1.6/GraphQL/Query/Context/SharedMethods.html new file mode 100644 index 0000000000..ba86fcd77d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/Context/SharedMethods.html @@ -0,0 +1,425 @@ + + + + + + + Module: GraphQL::Query::Context::SharedMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Query::Context::SharedMethods + + + +

+
+ + + + + + + + + +
+
Included in:
+
GraphQL::Query::Context
+
+ + + +
+
Defined in:
+
lib/graphql/query/context.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #add_error(error) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Add error at query-level.

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/query/context.rb', line 19
+
+def add_error(error)
+  if !error.is_a?(ExecutionError)
+    raise TypeError, "expected error to be a ExecutionError, but was #{error.class}"
+  end
+  errors << error
+  nil
+end
+
+
+ +
+

+ + #backtraceGraphQL::Backtrace + + + + + +

+
+

Returns The backtrace for this point in query execution.

+ + +
+
+
+ +
+

Examples:

+ + +

Print the GraphQL backtrace during field resolution

+

+ +
puts ctx.backtrace
+ +
+ +

Returns:

+
    + +
  • + + + (GraphQL::Backtrace) + + + + — +

    The backtrace for this point in query execution

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'lib/graphql/query/context.rb', line 31
+
+def backtrace
+  GraphQL::Backtrace.new(self)
+end
+
+
+ +
+

+ + #execution_errorsObject + + + + + +

+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/graphql/query/context.rb', line 35
+
+def execution_errors
+  @execution_errors ||= ExecutionErrors.new(self)
+end
+
+
+ +
+

+ + #skipObject + + + + + +

+
+

Return this value to tell the runtime +to exclude this field from the response altogether

+ + +
+
+
+ + +
+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/query/context.rb', line 12
+
+def skip
+  GraphQL::Execution::SKIP
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/Fingerprint.html b/api-doc/2.1.6/GraphQL/Query/Fingerprint.html new file mode 100644 index 0000000000..01550cdc12 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/Fingerprint.html @@ -0,0 +1,258 @@ + + + + + + + Module: GraphQL::Query::Fingerprint + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Query::Fingerprint + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/query/fingerprint.rb
+
+ +
+ +

Overview

+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +

See Also:

+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ +
    + +
  • + + + .generate(input_str) ⇒ String + + + + + + + + + + + private + + +

    Make an obfuscated hash of the given string (either a query string or variables JSON).

    +
    + +
  • + + +
+ + + + +
+

Class Method Details

+ + +
+

+ + .generate(input_str) ⇒ String + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Make an obfuscated hash of the given string (either a query string or variables JSON)

+ + +
+
+
+

Parameters:

+
    + +
  • + + string + + + (String) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    A normalized, opaque hash

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
+
# File 'lib/graphql/query/fingerprint.rb', line 15
+
+def self.generate(input_str)
+  # Implemented to be:
+  # - Short (and uniform) length
+  # - Stable
+  # - Irreversibly Opaque (don't want to leak variable values)
+  # - URL-friendly
+  bytes = Digest::SHA256.digest(input_str)
+  Base64.urlsafe_encode64(bytes)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/InputValidationResult.html b/api-doc/2.1.6/GraphQL/Query/InputValidationResult.html new file mode 100644 index 0000000000..8ea4dffc93 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/InputValidationResult.html @@ -0,0 +1,593 @@ + + + + + + + Class: GraphQL::Query::InputValidationResult + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::InputValidationResult + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/query/input_validation_result.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
VALID = + +
+
self.new
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #problems ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute problems.

    +
    + +
  • + + +
+ + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(valid: true, problems: nil) ⇒ InputValidationResult + + + + + +

+
+

Returns a new instance of InputValidationResult.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+
+
# File 'lib/graphql/query/input_validation_result.rb', line 13
+
+def initialize(valid: true, problems: nil)
+  @valid = valid
+  @problems = problems
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #problemsObject + + + + + +

+
+

Returns the value of attribute problems.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/query/input_validation_result.rb', line 5
+
+def problems
+  @problems
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .from_problem(explanation, path = nil, extensions: nil, message: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+11
+
+
# File 'lib/graphql/query/input_validation_result.rb', line 7
+
+def self.from_problem(explanation, path = nil, extensions: nil, message: nil)
+  result = self.new
+  result.add_problem(explanation, path, extensions: extensions, message: message)
+  result
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #add_problem(explanation, path = nil, extensions: nil, message: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
+
# File 'lib/graphql/query/input_validation_result.rb', line 22
+
+def add_problem(explanation, path = nil, extensions: nil, message: nil)
+  @problems ||= []
+  @valid = false
+  problem = { "path" => path || [], "explanation" => explanation }
+  if extensions
+    problem["extensions"] = extensions
+  end
+  if message
+    problem["message"] = message
+  end
+  @problems.push(problem)
+end
+
+
+ +
+

+ + #merge_result!(path, inner_result) ⇒ Object + + + + + +

+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'lib/graphql/query/input_validation_result.rb', line 35
+
+def merge_result!(path, inner_result)
+  return if inner_result.nil? || inner_result.valid?
+
+  if inner_result.problems
+    inner_result.problems.each do |p|
+      item_path = [path, *p["path"]]
+      add_problem(p["explanation"], item_path, message: p["message"], extensions: p["extensions"])
+    end
+  end
+  # It could have been explicitly set on inner_result (if it had no problems)
+  @valid = false
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/graphql/query/input_validation_result.rb', line 18
+
+def valid?
+  @valid
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/NullContext.html b/api-doc/2.1.6/GraphQL/Query/NullContext.html new file mode 100644 index 0000000000..51fa33afcc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/NullContext.html @@ -0,0 +1,611 @@ + + + + + + + Class: GraphQL::Query::NullContext + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::NullContext + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + +
+
Includes:
+
Singleton
+
+ + + + + + +
+
Defined in:
+
lib/graphql/query/null_context.rb
+
+ +
+ +

Overview

+
+

This object can be ctx in places where there is no query

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: NullQuery, NullSchema + + +

+ + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #dataloader ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute dataloader.

    +
    + +
  • + + +
  • + + + #query ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute query.

    +
    + +
  • + + +
  • + + + #schema ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute schema.

    +
    + +
  • + + +
  • + + + #warden ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute warden.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initializeNullContext + + + + + +

+
+

Returns a new instance of NullContext.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+25
+26
+27
+
+
# File 'lib/graphql/query/null_context.rb', line 22
+
+def initialize
+  @query = NullQuery.new
+  @dataloader = GraphQL::Dataloader::NullDataloader.new
+  @schema = NullSchema
+  @warden = Schema::Warden::NullWarden.new(context: self, schema: @schema)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #dataloaderObject (readonly) + + + + + +

+
+

Returns the value of attribute dataloader.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/query/null_context.rb', line 19
+
+def dataloader
+  @dataloader
+end
+
+
+ + + +
+

+ + #queryObject (readonly) + + + + + +

+
+

Returns the value of attribute query.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/query/null_context.rb', line 19
+
+def query
+  @query
+end
+
+
+ + + +
+

+ + #schemaObject (readonly) + + + + + +

+
+

Returns the value of attribute schema.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/query/null_context.rb', line 19
+
+def schema
+  @schema
+end
+
+
+ + + +
+

+ + #wardenObject (readonly) + + + + + +

+
+

Returns the value of attribute warden.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/query/null_context.rb', line 19
+
+def warden
+  @warden
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #interpreter?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/graphql/query/null_context.rb', line 29
+
+def interpreter?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/NullContext/NullQuery.html b/api-doc/2.1.6/GraphQL/Query/NullContext/NullQuery.html new file mode 100644 index 0000000000..5c5e248206 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/NullContext/NullQuery.html @@ -0,0 +1,214 @@ + + + + + + + Class: GraphQL::Query::NullContext::NullQuery + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::NullContext::NullQuery + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/query/null_context.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #after_lazy(value) {|value| ... } ⇒ Object + + + + + +

+
+ + + +
+
+
+ +

Yields:

+
    + +
  • + + + (value) + + + +
  • + +
+ +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/query/null_context.rb', line 9
+
+def after_lazy(value)
+  yield(value)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/NullContext/NullSchema.html b/api-doc/2.1.6/GraphQL/Query/NullContext/NullSchema.html new file mode 100644 index 0000000000..de37f0ccaa --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/NullContext/NullSchema.html @@ -0,0 +1,162 @@ + + + + + + + Class: GraphQL::Query::NullContext::NullSchema + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::NullContext::NullSchema + + + +

+
+ +
+
Inherits:
+
+ Schema + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/query/null_context.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from Schema

+

Schema::BUILT_IN_TYPES, Schema::NEW_HANDLER_HASH

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from Schema

+

add_subscription_extension_if_necessary, after_any_lazies, after_lazy, as_json, build_trace_mode, context_class, count_introspection_fields, cursor_encoder, default_analysis_engine, default_directives, default_execution_strategy, default_logger, default_max_page_size, default_page_size, default_trace_mode, deprecated_graphql_definition, description, directive, directives, disable_introspection_entry_points, disable_introspection_entry_points?, disable_schema_introspection_entry_point, disable_schema_introspection_entry_point?, disable_type_introspection_entry_point, disable_type_introspection_entry_point?, error_handlers, execute, find, from_definition, from_introspection, get_field, get_fields, get_type, handle_or_reraise, id_from_object, inherited, instrument, instrumenters, interpreter?, introspection, introspection_system, lazy?, lazy_method_name, lazy_resolve, multiplex, multiplex_analyzer, multiplex_analyzers, mutation, mutation_execution_strategy, new_connections?, new_trace, object_from_id, orphan_types, own_trace_modes, own_trace_modules, parse_error, plugins, possible_types, query, query_analyzer, query_analyzers, query_execution_strategy, query_stack_error, references_to, rescue_from, resolve_type, root_type_for_operation, root_types, sanitized_printer, schema_directive, schema_directives, static_validator, subscription, subscription_execution_strategy, subscriptions, subscriptions=, sync_lazy, to_definition, to_document, to_json, trace_class, trace_class_for, trace_mode, trace_modules_for, trace_options_for, trace_with, tracer, tracers, type_error, type_from_ast, types, unauthorized_field, unauthorized_object, union_memberships, use, using_ast_analysis?, validate, visible?

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/OperationNameMissingError.html b/api-doc/2.1.6/GraphQL/Query/OperationNameMissingError.html new file mode 100644 index 0000000000..5bccf92366 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/OperationNameMissingError.html @@ -0,0 +1,240 @@ + + + + + + + Exception: GraphQL::Query::OperationNameMissingError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Query::OperationNameMissingError + + + +

+
+ +
+
Inherits:
+
+ ExecutionError + +
    +
  • Object
  • + + + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/query.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from ExecutionError

+

#ast_node, #extensions, #options, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from ExecutionError

+

#to_h

+ + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(name) ⇒ OperationNameMissingError + + + + + +

+
+

Returns a new instance of OperationNameMissingError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/query.rb', line 18
+
+def initialize(name)
+  msg = if name.nil?
+    %|An operation name is required|
+  else
+    %|No operation named "#{name}"|
+  end
+  super(msg)
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/Result.html b/api-doc/2.1.6/GraphQL/Query/Result.html new file mode 100644 index 0000000000..cc9b091899 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/Result.html @@ -0,0 +1,716 @@ + + + + + + + Class: GraphQL::Query::Result + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::Result + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/query/result.rb
+
+ +
+ +

Overview

+
+

A result from Schema#execute. +It provides the requested data and +access to the GraphQL::Query and Context.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #query ⇒ GraphQL::Query + + + + + + + + + readonly + + + + + + + + + +

    The query that was executed.

    +
    + +
  • + + +
  • + + + #to_h ⇒ Hash + + + + + + + + + readonly + + + + + + + + + +

    The resulting hash of “data” and/or “errors”.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(query:, values:) ⇒ Result + + + + + +

+
+

Returns a new instance of Result.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+
+
# File 'lib/graphql/query/result.rb', line 11
+
+def initialize(query:, values:)
+  @query = query
+  @to_h = values
+end
+
+
+ +
+
+

Dynamic Method Handling

+

+ This class handles dynamic methods through the method_missing method + +

+ +
+

+ + #method_missing(method_name, *args, &block) ⇒ Object + + + + + +

+
+

Delegate any hash-like method to the underlying hash.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+30
+31
+32
+33
+
+
# File 'lib/graphql/query/result.rb', line 27
+
+def method_missing(method_name, *args, &block)
+  if @to_h.respond_to?(method_name)
+    @to_h.public_send(method_name, *args, &block)
+  else
+    super
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #queryGraphQL::Query (readonly) + + + + + +

+
+

Returns The query that was executed.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Query) + + + + — +

    The query that was executed

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/query/result.rb', line 17
+
+def query
+  @query
+end
+
+
+ + + +
+

+ + #to_hHash (readonly) + + + + + +

+
+

Returns The resulting hash of “data” and/or “errors”.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    The resulting hash of “data” and/or “errors”

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/query/result.rb', line 20
+
+def to_h
+  @to_h
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #==(other) ⇒ Boolean + + + + + +

+
+

A result is equal to another object when:

+ +
    +
  • The other object is a Hash whose value matches result.to_h
  • +
  • The other object is a Result whose value matches result.to_h
  • +
+ +

(The query is ignored for comparing result equality.)

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
+
# File 'lib/graphql/query/result.rb', line 51
+
+def ==(other)
+  case other
+  when Hash
+    @to_h == other
+  when Query::Result
+    @to_h == other.to_h
+  else
+    super
+  end
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+39
+40
+41
+
+
# File 'lib/graphql/query/result.rb', line 39
+
+def inspect
+  "#<GraphQL::Query::Result @query=... @to_h=#{@to_h}>"
+end
+
+
+ +
+

+ + #respond_to_missing?(method_name, include_private = false) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/graphql/query/result.rb', line 35
+
+def respond_to_missing?(method_name, include_private = false)
+  @to_h.respond_to?(method_name) || super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/ValidationPipeline.html b/api-doc/2.1.6/GraphQL/Query/ValidationPipeline.html new file mode 100644 index 0000000000..8c87ce5815 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/ValidationPipeline.html @@ -0,0 +1,731 @@ + + + + + + + Class: GraphQL::Query::ValidationPipeline + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::ValidationPipeline + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/query/validation_pipeline.rb
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

Contain the validation pipeline and expose the results.

+ +
    +
  1. Checks in #initialize: + - Rescue a ParseError, halt if there is one + - Check for selected operation, halt if not found
  2. +
  3. Validate the AST, halt if errors
  4. +
  5. Validate the variables, halt if errors
  6. +
  7. Run query analyzers, halt if errors
  8. +
+ +

#valid? is false if any of the above checks halted the pipeline.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(query:, parse_error:, operation_name_error:, max_depth:, max_complexity:) ⇒ ValidationPipeline + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of ValidationPipeline.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
+
# File 'lib/graphql/query/validation_pipeline.rb', line 19
+
+def initialize(query:, parse_error:, operation_name_error:, max_depth:, max_complexity:)
+  @validation_errors = []
+  @parse_error = parse_error
+  @operation_name_error = operation_name_error
+  @query = query
+  @schema = query.schema
+  @max_depth = max_depth
+  @max_complexity = max_complexity
+
+  @has_validated = false
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #max_complexityObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/query/validation_pipeline.rb', line 17
+
+def max_complexity
+  @max_complexity
+end
+
+
+ + + +
+

+ + #max_depthObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/query/validation_pipeline.rb', line 17
+
+def max_depth
+  @max_depth
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #analyzersObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+43
+44
+45
+46
+
+
# File 'lib/graphql/query/validation_pipeline.rb', line 43
+
+def analyzers
+  ensure_has_validated
+  @query_analyzers
+end
+
+
+ +
+

+ + #has_validated?Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'lib/graphql/query/validation_pipeline.rb', line 48
+
+def has_validated?
+  @has_validated == true
+end
+
+
+ +
+

+ + #valid?Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns does this query have errors that should prevent it from running?.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    does this query have errors that should prevent it from running?

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+32
+33
+34
+35
+
+
# File 'lib/graphql/query/validation_pipeline.rb', line 32
+
+def valid?
+  ensure_has_validated
+  @valid
+end
+
+
+ +
+

+ + #validation_errorsArray<GraphQL::StaticValidation::Error, GraphQL::Query::VariableValidationError> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Static validation errors for the query string.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+38
+39
+40
+41
+
+
# File 'lib/graphql/query/validation_pipeline.rb', line 38
+
+def validation_errors
+  ensure_has_validated
+  @validation_errors
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/VariableValidationError.html b/api-doc/2.1.6/GraphQL/Query/VariableValidationError.html new file mode 100644 index 0000000000..3419cc9982 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/VariableValidationError.html @@ -0,0 +1,468 @@ + + + + + + + Exception: GraphQL::Query::VariableValidationError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Query::VariableValidationError + + + +

+
+ +
+
Inherits:
+
+ ExecutionError + +
    +
  • Object
  • + + + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/query/variable_validation_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #validation_result ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute validation_result.

    +
    + +
  • + + +
  • + + + #value ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute value.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from ExecutionError

+

#ast_node, #extensions, #options, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(variable_ast, type, value, validation_result, msg: nil) ⇒ VariableValidationError + + + + + +

+
+

Returns a new instance of VariableValidationError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
+
# File 'lib/graphql/query/variable_validation_error.rb', line 7
+
+def initialize(variable_ast, type, value, validation_result, msg: nil)
+  @value = value
+  @validation_result = validation_result
+
+  msg ||= "Variable $#{variable_ast.name} of type #{type.to_type_signature} was provided invalid value"
+
+  if problem_fields.any?
+    msg += " for #{problem_fields.join(", ")}"
+  end
+
+  super(msg)
+  self.ast_node = variable_ast
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #validation_resultObject + + + + + +

+
+

Returns the value of attribute validation_result.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/query/variable_validation_error.rb', line 5
+
+def validation_result
+  @validation_result
+end
+
+
+ + + +
+

+ + #valueObject + + + + + +

+
+

Returns the value of attribute value.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/query/variable_validation_error.rb', line 5
+
+def value
+  @value
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #to_hObject + + + + + +

+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
+
# File 'lib/graphql/query/variable_validation_error.rb', line 21
+
+def to_h
+  # It is possible there are other extension items in this error, so handle
+  # a one level deep merge explicitly. However beyond that only show the
+  # latest value and problems.
+  super.merge({ "extensions" => { "value" => value, "problems" => validation_result.problems }}) do |key, oldValue, newValue|
+    if oldValue.respond_to?(:merge)
+      oldValue.merge(newValue)
+    else
+      newValue
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Query/Variables.html b/api-doc/2.1.6/GraphQL/Query/Variables.html new file mode 100644 index 0000000000..55615d9a0d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Query/Variables.html @@ -0,0 +1,482 @@ + + + + + + + Class: GraphQL::Query::Variables + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Query::Variables + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/query/variables.rb
+
+ +
+ +

Overview

+
+

Read-only access to query variables, applying default values if needed.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(ctx, ast_variables, provided_variables) ⇒ Variables + + + + + +

+
+

Returns a new instance of Variables.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
+
# File 'lib/graphql/query/variables.rb', line 13
+
+def initialize(ctx, ast_variables, provided_variables)
+  schema = ctx.schema
+  @context = ctx
+
+  @provided_variables = deep_stringify(provided_variables)
+  @errors = []
+  @storage = ast_variables.each_with_object({}) do |ast_variable, memo|
+    if schema.validate_max_errors && schema.validate_max_errors <= @errors.count
+      add_max_errors_reached_message
+      break
+    end
+    # Find the right value for this variable:
+    # - First, use the value provided at runtime
+    # - Then, fall back to the default value from the query string
+    # If it's still nil, raise an error if it's required.
+    variable_type = schema.type_from_ast(ast_variable.type, context: ctx)
+    if variable_type.nil?
+      # Pass -- it will get handled by a validator
+    else
+      variable_name = ast_variable.name
+      default_value = ast_variable.default_value
+      provided_value = @provided_variables[variable_name]
+      value_was_provided =  @provided_variables.key?(variable_name)
+      max_errors = schema.validate_max_errors - @errors.count if schema.validate_max_errors
+      begin
+        validation_result = variable_type.validate_input(provided_value, ctx, max_errors: max_errors)
+        if validation_result.valid?
+          if value_was_provided
+            # Add the variable if a value was provided
+            memo[variable_name] = provided_value
+          elsif default_value != nil
+            memo[variable_name] = if default_value.is_a?(Language::Nodes::NullValue)
+              nil
+            else
+              default_value
+            end
+          end
+        end
+      rescue GraphQL::ExecutionError => ex
+        # TODO: This should really include the path to the problematic node in the variable value
+        # like InputValidationResults generated by validate_non_null_input but unfortunately we don't
+        # have this information available in the coerce_input call chain. Note this path is the path
+        # that appears under errors.extensions.problems.path and NOT the result path under errors.path.
+        validation_result = GraphQL::Query::InputValidationResult.from_problem(ex.message)
+      end
+
+      if !validation_result.valid?
+        @errors << GraphQL::Query::VariableValidationError.new(ast_variable, variable_type, provided_value, validation_result)
+      end
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #contextObject (readonly) + + + + + +

+
+

Returns the value of attribute context.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'lib/graphql/query/variables.rb', line 11
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #errorsArray<GraphQL::Query::VariableValidationError> (readonly) + + + + + +

+
+

Returns Any errors encountered when parsing the provided variables and literal values.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/query/variables.rb', line 9
+
+def errors
+  @errors
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Railtie.html b/api-doc/2.1.6/GraphQL/Railtie.html new file mode 100644 index 0000000000..68db3e227f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Railtie.html @@ -0,0 +1,124 @@ + + + + + + + Class: GraphQL::Railtie + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Railtie + + + +

+
+ +
+
Inherits:
+
+ Rails::Railtie + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/railtie.rb
+
+ +
+ + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/RakeTask.html b/api-doc/2.1.6/GraphQL/RakeTask.html new file mode 100644 index 0000000000..02ea8ad1aa --- /dev/null +++ b/api-doc/2.1.6/GraphQL/RakeTask.html @@ -0,0 +1,1523 @@ + + + + + + + Class: GraphQL::RakeTask + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::RakeTask + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Rake::DSL
+
+ + + +
+
Includes:
+
Rake::DSL
+
+ + + + + + +
+
Defined in:
+
lib/graphql/rake_task.rb,
+ lib/graphql/rake_task/validate.rb
+
+
+ +
+ +

Overview

+
+

A rake task for dumping a schema as IDL or JSON.

+ +

By default, schemas are looked up by name as constants using schema_name:. +You can provide a load_schema function to return your schema another way.

+ +

Use load_context: and visible? to dump schemas under certain visibility constraints.

+ + +
+
+
+ +
+

Examples:

+ + +

Dump a Schema to .graphql + .json files

+

+ +
require "graphql/rake_task"
+GraphQL::RakeTask.new(schema_name: "MySchema")
+
+# $ rake graphql:schema:dump
+# Schema IDL dumped to ./schema.graphql
+# Schema JSON dumped to ./schema.json
+ + +

Invoking the task from Ruby

+

+ +
require "rake"
+Rake::Task["graphql:schema:dump"].invoke
+ + +

Providing arguments to build the introspection query

+

+ +
require "graphql/rake_task"
+GraphQL::RakeTask.new(schema_name: "MySchema", include_is_one_of: true)
+ +
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
DEFAULT_OPTIONS = + +
+
{
+  namespace: "graphql",
+  dependencies: nil,
+  schema_name: nil,
+  load_schema: ->(task) { Object.const_get(task.schema_name) },
+  load_context: ->(task) { {} },
+  directory: ".",
+  idl_outfile: "schema.graphql",
+  json_outfile: "schema.json",
+  include_deprecated_args: true,
+  include_schema_description: false,
+  include_is_repeatable: false,
+  include_specified_by_url: false,
+  include_is_one_of: false
+}
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(options = {}) ⇒ RakeTask + + + + + +

+
+

Set the parameters of this task by passing keyword arguments +or assigning attributes inside the block

+ + +
+
+
+ + +
+ + + + +
+
+
+
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+
+
# File 'lib/graphql/rake_task.rb', line 83
+
+def initialize(options = {})
+  all_options = DEFAULT_OPTIONS.merge(options)
+  all_options.each do |k, v|
+    self.public_send("#{k}=", v)
+  end
+
+  if block_given?
+    yield(self)
+  end
+
+  define_task
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #dependenciesArray<String> + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<String>) + + + +
  • + +
+ +
+ + + + +
+
+
+
+56
+57
+58
+
+
# File 'lib/graphql/rake_task.rb', line 56
+
+def dependencies
+  @dependencies
+end
+
+
+ + + +
+

+ + #directoryString + + + + + +

+
+

Returns directory for IDL & JSON files.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    directory for IDL & JSON files

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+75
+76
+77
+
+
# File 'lib/graphql/rake_task.rb', line 75
+
+def directory
+  @directory
+end
+
+
+ + + +
+

+ + #idl_outfileString + + + + + +

+
+

Returns target for IDL task.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    target for IDL task

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/graphql/rake_task.rb', line 69
+
+def idl_outfile
+  @idl_outfile
+end
+
+
+ + + +
+

+ + #include_deprecated_argsBoolean + + + + + +

+
+

Returns Options for additional fields in the introspection query JSON response.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Options for additional fields in the introspection query JSON response

    +
    + +
  • + +
+ +

See Also:

+ + +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'lib/graphql/rake_task.rb', line 79
+
+def include_deprecated_args
+  @include_deprecated_args
+end
+
+
+ + + +
+

+ + #include_is_one_ofBoolean + + + + + +

+
+

Returns Options for additional fields in the introspection query JSON response.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Options for additional fields in the introspection query JSON response

    +
    + +
  • + +
+ +

See Also:

+ + +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'lib/graphql/rake_task.rb', line 79
+
+def include_is_one_of
+  @include_is_one_of
+end
+
+
+ + + +
+

+ + #include_is_repeatableBoolean + + + + + +

+
+

Returns Options for additional fields in the introspection query JSON response.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Options for additional fields in the introspection query JSON response

    +
    + +
  • + +
+ +

See Also:

+ + +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'lib/graphql/rake_task.rb', line 79
+
+def include_is_repeatable
+  @include_is_repeatable
+end
+
+
+ + + +
+

+ + #include_schema_descriptionBoolean + + + + + +

+
+

Returns Options for additional fields in the introspection query JSON response.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Options for additional fields in the introspection query JSON response

    +
    + +
  • + +
+ +

See Also:

+ + +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'lib/graphql/rake_task.rb', line 79
+
+def include_schema_description
+  @include_schema_description
+end
+
+
+ + + +
+

+ + #include_specified_by_urlBoolean + + + + + +

+
+

Returns Options for additional fields in the introspection query JSON response.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Options for additional fields in the introspection query JSON response

    +
    + +
  • + +
+ +

See Also:

+ + +
+ + + + +
+
+
+
+79
+80
+81
+
+
# File 'lib/graphql/rake_task.rb', line 79
+
+def include_specified_by_url
+  @include_specified_by_url
+end
+
+
+ + + +
+

+ + #json_outfileString + + + + + +

+
+

Returns target for JSON task.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    target for JSON task

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+72
+73
+74
+
+
# File 'lib/graphql/rake_task.rb', line 72
+
+def json_outfile
+  @json_outfile
+end
+
+
+ + + +
+

+ + #load_context<#call(task)> + + + + + +

+
+

Returns A callable for loading the query context.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (<#call(task)>) + + + + — +

    A callable for loading the query context

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+66
+67
+68
+
+
# File 'lib/graphql/rake_task.rb', line 66
+
+def load_context
+  @load_context
+end
+
+
+ + + +
+

+ + #load_schema<#call(task)> + + + + + +

+
+

Returns A proc for loading the target GraphQL schema.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (<#call(task)>) + + + + — +

    A proc for loading the target GraphQL schema

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+63
+64
+65
+
+
# File 'lib/graphql/rake_task.rb', line 63
+
+def load_schema
+  @load_schema
+end
+
+
+ + + +
+

+ + #namespace=(value) ⇒ String (writeonly) + + + + + +

+
+

Returns Namespace for generated tasks.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    Namespace for generated tasks

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+49
+50
+51
+
+
# File 'lib/graphql/rake_task.rb', line 49
+
+def namespace=(value)
+  @namespace = value
+end
+
+
+ + + +
+

+ + #schema_nameString + + + + + +

+
+

Returns By default, used to find the schema as a constant.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    By default, used to find the schema as a constant.

    +
    + +
  • + +
+ +

See Also:

+
    + +
  • for loading a schema another way
  • + +
+ +
+ + + + +
+
+
+
+60
+61
+62
+
+
# File 'lib/graphql/rake_task.rb', line 60
+
+def schema_name
+  @schema_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #rake_namespaceObject + + + + + +

+ + + + +
+
+
+
+51
+52
+53
+
+
# File 'lib/graphql/rake_task.rb', line 51
+
+def rake_namespace
+  @namespace
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Relay.html b/api-doc/2.1.6/GraphQL/Relay.html new file mode 100644 index 0000000000..9fbef7b7cb --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Relay.html @@ -0,0 +1,115 @@ + + + + + + + Module: GraphQL::Relay + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Relay + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/relay/range_add.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: RangeAdd + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Relay/RangeAdd.html b/api-doc/2.1.6/GraphQL/Relay/RangeAdd.html new file mode 100644 index 0000000000..2699429e3a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Relay/RangeAdd.html @@ -0,0 +1,566 @@ + + + + + + + Class: GraphQL::Relay::RangeAdd + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Relay::RangeAdd + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/relay/range_add.rb
+
+ +
+ +

Overview

+
+

This provides some isolation from GraphQL::Relay internals.

+ +

Given a list of items and a new item, it will provide a connection and an edge.

+ +

The connection doesn’t receive outside arguments, so the list of items +should be ordered and paginated before providing it here.

+ + +
+
+
+ +
+

Examples:

+ + +

Adding a comment to list of comments

+

+ +
post = Post.find(args[:post_id])
+comments = post.comments
+new_comment = comments.build(body: args[:body])
+new_comment.save!
+
+range_add = GraphQL::Relay::RangeAdd.new(
+  parent: post,
+  collection: comments,
+  item: new_comment,
+  context: context,
+)
+
+response = {
+  post: post,
+  comments_connection: range_add.connection,
+  new_comment_edge: range_add.edge,
+}
+ +
+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #connection ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute connection.

    +
    + +
  • + + +
  • + + + #edge ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute edge.

    +
    + +
  • + + +
  • + + + #parent ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute parent.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(collection:, item:, context:, parent: nil, edge_class: nil) ⇒ RangeAdd + + + + + +

+
+

Returns a new instance of RangeAdd.

+ + +
+
+
+

Parameters:

+
    + +
  • + + collection + + + (Object) + + + + — +

    The list of items to wrap in a connection

    +
    + +
  • + +
  • + + item + + + (Object) + + + + — +

    The newly-added item (will be wrapped in edge_class)

    +
    + +
  • + +
  • + + context + + + (GraphQL::Query::Context) + + + + — +

    The surrounding ctx, will be passed to the connection

    +
    + +
  • + +
  • + + parent + + + (Object) + + + (defaults to: nil) + + + — +

    The owner of collection, will be passed to the connection if provided

    +
    + +
  • + +
  • + + edge_class + + + (Class) + + + (defaults to: nil) + + + — +

    The class to wrap item with (defaults to the connection’s edge class)

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
+
# File 'lib/graphql/relay/range_add.rb', line 37
+
+def initialize(collection:, item:, context:, parent: nil, edge_class: nil)
+  conn_class = context.schema.connections.wrapper_for(collection)
+  # The rest will be added by ConnectionExtension
+  @connection = conn_class.new(collection, parent: parent, context: context, edge_class: edge_class)
+  # Check if this connection supports it, to support old versions of GraphQL-Pro
+  @edge = if @connection.respond_to?(:range_add_edge)
+    @connection.range_add_edge(item)
+  else
+    @connection.edge_class.new(item, @connection)
+  end
+
+  @parent = parent
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #connectionObject (readonly) + + + + + +

+
+

Returns the value of attribute connection.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/relay/range_add.rb', line 30
+
+def connection
+  @connection
+end
+
+
+ + + +
+

+ + #edgeObject (readonly) + + + + + +

+
+

Returns the value of attribute edge.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/relay/range_add.rb', line 30
+
+def edge
+  @edge
+end
+
+
+ + + +
+

+ + #parentObject (readonly) + + + + + +

+
+

Returns the value of attribute parent.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/relay/range_add.rb', line 30
+
+def parent
+  @parent
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/RequiredImplementationMissingError.html b/api-doc/2.1.6/GraphQL/RequiredImplementationMissingError.html new file mode 100644 index 0000000000..e4bd92b9ae --- /dev/null +++ b/api-doc/2.1.6/GraphQL/RequiredImplementationMissingError.html @@ -0,0 +1,132 @@ + + + + + + + Exception: GraphQL::RequiredImplementationMissingError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::RequiredImplementationMissingError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql.rb
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Rubocop.html b/api-doc/2.1.6/GraphQL/Rubocop.html new file mode 100644 index 0000000000..bf10676ef3 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Rubocop.html @@ -0,0 +1,117 @@ + + + + + + + Module: GraphQL::Rubocop + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Rubocop + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/rubocop/graphql/base_cop.rb,
+ lib/graphql/rubocop/graphql/default_null_true.rb,
lib/graphql/rubocop/graphql/default_required_true.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: GraphQL + + + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Rubocop/GraphQL.html b/api-doc/2.1.6/GraphQL/Rubocop/GraphQL.html new file mode 100644 index 0000000000..601f4067b3 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Rubocop/GraphQL.html @@ -0,0 +1,117 @@ + + + + + + + Module: GraphQL::Rubocop::GraphQL + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Rubocop::GraphQL + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/rubocop/graphql/base_cop.rb,
+ lib/graphql/rubocop/graphql/default_null_true.rb,
lib/graphql/rubocop/graphql/default_required_true.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: BaseCop, DefaultNullTrue, DefaultRequiredTrue + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Rubocop/GraphQL/BaseCop.html b/api-doc/2.1.6/GraphQL/Rubocop/GraphQL/BaseCop.html new file mode 100644 index 0000000000..ee9b0c142b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Rubocop/GraphQL/BaseCop.html @@ -0,0 +1,252 @@ + + + + + + + Class: GraphQL::Rubocop::GraphQL::BaseCop + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Rubocop::GraphQL::BaseCop + + + +

+
+ +
+
Inherits:
+
+ RuboCop::Cop::Base + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
RuboCop::Cop::AutoCorrector
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/rubocop/graphql/base_cop.rb
+
+ +
+ +
+

Direct Known Subclasses

+

DefaultNullTrue, DefaultRequiredTrue

+
+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + +
+

Instance Method Details

+ + +
+

+ + #source_without_keyword_argument(send_node, pair_node) ⇒ Object + + + + + +

+
+

Return the source of send_node, but without the keyword argument represented by pair_node

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
+
# File 'lib/graphql/rubocop/graphql/base_cop.rb', line 11
+
+def source_without_keyword_argument(send_node, pair_node)
+  # work back to the preceeding comma
+  first_pos = pair_node.location.expression.begin_pos
+  end_pos = pair_node.location.expression.end_pos
+  node_source = send_node.source_range.source
+  node_first_pos = send_node.location.expression.begin_pos
+
+  relative_first_pos = first_pos - node_first_pos
+  relative_last_pos = end_pos - node_first_pos
+
+  begin_removal_pos = relative_first_pos
+  while node_source[begin_removal_pos] != ","
+    begin_removal_pos -= 1
+    if begin_removal_pos < 1
+      raise "Invariant: somehow backtracked to beginning of node looking for a comma (node source: #{node_source.inspect})"
+    end
+  end
+
+  end_removal_pos = relative_last_pos
+  cleaned_node_source = node_source[0...begin_removal_pos] + node_source[end_removal_pos..-1]
+  cleaned_node_source
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Rubocop/GraphQL/DefaultNullTrue.html b/api-doc/2.1.6/GraphQL/Rubocop/GraphQL/DefaultNullTrue.html new file mode 100644 index 0000000000..8af1f88ddc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Rubocop/GraphQL/DefaultNullTrue.html @@ -0,0 +1,263 @@ + + + + + + + Class: GraphQL::Rubocop::GraphQL::DefaultNullTrue + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Rubocop::GraphQL::DefaultNullTrue + + + +

+
+ +
+
Inherits:
+
+ BaseCop + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/rubocop/graphql/default_null_true.rb
+
+ +
+ +

Overview

+
+

Identify (and auto-correct) any field configuration which duplicates +the default null: true property.

+ +

null: true is default because nullable fields can always be converted +to non-null fields (null: false) without a breaking change. (The opposite change, from null: false +to null: true, change.)

+ + +
+
+
+ +
+

Examples:

+ + +
# Both of these define `name: String` in GraphQL:
+
+# bad
+field :name, String, null: true
+
+# good
+field :name, String
+ +
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
MSG = + +
+
"`null: true` is the default and can be removed."
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from BaseCop

+

#source_without_keyword_argument

+ + + + +
+

Instance Method Details

+ + +
+

+ + #on_send(node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+38
+39
+
+
# File 'lib/graphql/rubocop/graphql/default_null_true.rb', line 32
+
+def on_send(node)
+  field_config_with_null_true?(node) do |null_config|
+    add_offense(null_config) do |corrector|
+      cleaned_node_source = source_without_keyword_argument(node, null_config)
+      corrector.replace(node.source_range, cleaned_node_source)
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Rubocop/GraphQL/DefaultRequiredTrue.html b/api-doc/2.1.6/GraphQL/Rubocop/GraphQL/DefaultRequiredTrue.html new file mode 100644 index 0000000000..c80201f9a4 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Rubocop/GraphQL/DefaultRequiredTrue.html @@ -0,0 +1,263 @@ + + + + + + + Class: GraphQL::Rubocop::GraphQL::DefaultRequiredTrue + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Rubocop::GraphQL::DefaultRequiredTrue + + + +

+
+ +
+
Inherits:
+
+ BaseCop + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/rubocop/graphql/default_required_true.rb
+
+ +
+ +

Overview

+
+

Identify (and auto-correct) any argument configuration which duplicates +the default required: true property.

+ +

required: true is default because required arguments can always be converted +to optional arguments (required: false) without a breaking change. (The opposite change, from required: false +to required: true, change.)

+ + +
+
+
+ +
+

Examples:

+ + +
# Both of these define `id: ID!` in GraphQL:
+
+# bad
+argument :id, ID, required: true
+
+# good
+argument :id, ID
+ +
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
MSG = + +
+
"`required: true` is the default and can be removed."
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from BaseCop

+

#source_without_keyword_argument

+ + + + +
+

Instance Method Details

+ + +
+

+ + #on_send(node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+38
+39
+
+
# File 'lib/graphql/rubocop/graphql/default_required_true.rb', line 32
+
+def on_send(node)
+  argument_config_with_required_true?(node) do |required_config|
+    add_offense(required_config) do |corrector|
+      cleaned_node_source = source_without_keyword_argument(node, required_config)
+      corrector.replace(node, cleaned_node_source)
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Ruby2Keywords.html b/api-doc/2.1.6/GraphQL/Ruby2Keywords.html new file mode 100644 index 0000000000..7fd274a692 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Ruby2Keywords.html @@ -0,0 +1,183 @@ + + + + + + + Module: GraphQL::Ruby2Keywords + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Ruby2Keywords + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql.rb
+
+ +
+ +

Overview

+
+

forwards-compat for argument handling

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #ruby2_keywordsObject + + + + + +

+ + + + +
+
+
+
+12
+13
+
+
# File 'lib/graphql.rb', line 12
+
+def ruby2_keywords(*)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/RuntimeTypeError.html b/api-doc/2.1.6/GraphQL/RuntimeTypeError.html new file mode 100644 index 0000000000..f08afb4172 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/RuntimeTypeError.html @@ -0,0 +1,136 @@ + + + + + + + Exception: GraphQL::RuntimeTypeError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::RuntimeTypeError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/runtime_type_error.rb
+
+ +
+ + + + + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema.html b/api-doc/2.1.6/GraphQL/Schema.html new file mode 100644 index 0000000000..6d0a439d80 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema.html @@ -0,0 +1,8934 @@ + + + + + + + Class: GraphQL::Schema + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
FindInheritedValue, Member::HasAstNode
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/schema.rb,
+ lib/graphql/schema/enum.rb,
lib/graphql/schema/list.rb,
lib/graphql/schema/field.rb,
lib/graphql/schema/union.rb,
lib/graphql/schema/finder.rb,
lib/graphql/schema/loader.rb,
lib/graphql/schema/member.rb,
lib/graphql/schema/object.rb,
lib/graphql/schema/scalar.rb,
lib/graphql/schema/warden.rb,
lib/graphql/schema/printer.rb,
lib/graphql/schema/timeout.rb,
lib/graphql/schema/wrapper.rb,
lib/graphql/schema/addition.rb,
lib/graphql/schema/argument.rb,
lib/graphql/schema/mutation.rb,
lib/graphql/schema/non_null.rb,
lib/graphql/schema/resolver.rb,
lib/graphql/schema/directive.rb,
lib/graphql/schema/interface.rb,
lib/graphql/schema/null_mask.rb,
lib/graphql/schema/validator.rb,
lib/graphql/schema/enum_value.rb,
lib/graphql/schema/input_object.rb,
lib/graphql/schema/subscription.rb,
lib/graphql/schema/member/scoped.rb,
lib/graphql/schema/always_visible.rb,
lib/graphql/schema/built_in_types.rb,
lib/graphql/schema/directive/skip.rb,
lib/graphql/schema/base_64_encoder.rb,
lib/graphql/schema/field_extension.rb,
lib/graphql/schema/late_bound_type.rb,
lib/graphql/schema/member/has_path.rb,
lib/graphql/schema/type_expression.rb,
lib/graphql/schema/type_membership.rb,
lib/graphql/schema/directive/one_of.rb,
lib/graphql/schema/directive/feature.rb,
lib/graphql/schema/directive/flagged.rb,
lib/graphql/schema/directive/include.rb,
lib/graphql/schema/member/build_type.rb,
lib/graphql/schema/member/has_fields.rb,
lib/graphql/schema/invalid_type_error.rb,
lib/graphql/schema/unique_within_type.rb,
lib/graphql/schema/directive/transform.rb,
lib/graphql/schema/member/has_ast_node.rb,
lib/graphql/schema/directive/deprecated.rb,
lib/graphql/schema/find_inherited_value.rb,
lib/graphql/schema/introspection_system.rb,
lib/graphql/schema/member/has_arguments.rb,
lib/graphql/schema/build_from_definition.rb,
lib/graphql/schema/field/scope_extension.rb,
lib/graphql/schema/member/has_directives.rb,
lib/graphql/schema/member/has_interfaces.rb,
lib/graphql/schema/member/has_validators.rb,
lib/graphql/schema/directive/specified_by.rb,
lib/graphql/schema/member/relay_shortcuts.rb,
lib/graphql/schema/member/validates_input.rb,
lib/graphql/schema/relay_classic_mutation.rb,
lib/graphql/schema/member/base_dsl_methods.rb,
lib/graphql/schema/has_single_input_argument.rb,
lib/graphql/schema/member/graphql_type_names.rb,
lib/graphql/schema/resolver/has_payload_type.rb,
lib/graphql/schema/field/connection_extension.rb,
lib/graphql/schema/member/type_system_helpers.rb,
lib/graphql/schema/validator/format_validator.rb,
lib/graphql/schema/validator/length_validator.rb,
lib/graphql/schema/validator/required_validator.rb,
lib/graphql/schema/member/has_deprecation_reason.rb,
lib/graphql/schema/validator/exclusion_validator.rb,
lib/graphql/schema/validator/inclusion_validator.rb,
lib/graphql/schema/validator/allow_null_validator.rb,
lib/graphql/schema/validator/allow_blank_validator.rb,
lib/graphql/schema/member/has_unresolved_type_error.rb,
lib/graphql/schema/validator/numericality_validator.rb,
lib/graphql/schema/build_from_definition/resolve_map.rb,
lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb
+
+
+ +
+ +

Overview

+
+

A GraphQL schema which may be queried with Query.

+ +

The Schema contains:

+ +
    +
  • types for exposing your application
  • +
  • query analyzers for assessing incoming queries (including max depth & max complexity restrictions)
  • +
  • execution strategies for running incoming queries
  • +
+ +

Schemas start with root types, Schema.query, Schema.mutation and Schema.subscription. +The schema will traverse the tree of fields & types, using those as starting points. +Any undiscoverable types may be provided with the types configuration.

+ +

Schemas can restrict large incoming queries with max_depth and max_complexity configurations. +(These configurations can be overridden by specific calls to Schema.execute)

+ +

Schemas can specify how queries should be executed against them. +query_execution_strategy, mutation_execution_strategy and subscription_execution_strategy +each apply to corresponding root types.

+ + +
+
+
+ +
+

Examples:

+ + +

defining a schema

+

+ +
class MySchema < GraphQL::Schema
+  query QueryType
+  # If types are only connected by way of interfaces, they must be added here
+  orphan_types ImageType, AudioType
+end
+ +
+ + +
+

Direct Known Subclasses

+

Query::NullContext::NullSchema

+
+

Defined Under Namespace

+

+ + + Modules: Base64Encoder, BuildFromDefinition, FindInheritedValue, HasSingleInputArgument, Interface, Loader, NullMask, ResolveTypeWithType, SubclassGetReferencesTo, TypeExpression, UniqueWithinType + + + + Classes: Addition, AlwaysVisible, Argument, Directive, DuplicateNamesError, Enum, EnumValue, Field, FieldExtension, Finder, InputObject, IntrospectionSystem, InvalidDocumentError, InvalidTypeError, LateBoundType, List, Member, Mutation, NonNull, Object, Printer, RelayClassicMutation, Resolver, Scalar, Subscription, Timeout, TypeMembership, Union, UnresolvedLateBoundTypeError, Validator, Warden, Wrapper + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
NEW_HANDLER_HASH = + +
+
->(h, k) {
+  h[k] = {
+    class: k,
+    handler: nil,
+    subclass_handlers: Hash.new(&NEW_HANDLER_HASH),
+   }
+}
+ +
BUILT_IN_TYPES = + +
+
{
+  "Int" => GraphQL::Types::Int,
+  "String" => GraphQL::Types::String,
+  "Float" => GraphQL::Types::Float,
+  "Boolean" => GraphQL::Types::Boolean,
+  "ID" => GraphQL::Types::ID,
+}
+ +
+ + + + + +

Class Attribute Summary collapse

+ + + + + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Member::HasAstNode

+

inherited

+ + + + + + + +
+

Class Attribute Details

+ + + +
+

+ + .analysis_engineObject + + + + + +

+ + + + +
+
+
+
+717
+718
+719
+
+
# File 'lib/graphql/schema.rb', line 717
+
+def analysis_engine
+  @analysis_engine || find_inherited_value(:analysis_engine, self.default_analysis_engine)
+end
+
+
+ + + +
+

+ + .connectionsGraphQL::Pagination::Connections + + + + + +

+
+

Returns if installed.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+
+
# File 'lib/graphql/schema.rb', line 391
+
+def connections
+  if defined?(@connections)
+    @connections
+  else
+    inherited_connections = find_inherited_value(:connections, nil)
+    # This schema is part of an inheritance chain which is using new connections,
+    # make a new instance, so we don't pollute the upstream one.
+    if inherited_connections
+      @connections = Pagination::Connections.new(schema: self)
+    else
+      nil
+    end
+  end
+end
+
+
+ + + +
+

+ + .dataloader_classObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +

See Also:

+ + +
+ + + + +
+
+
+
+533
+534
+535
+
+
# File 'lib/graphql/schema.rb', line 533
+
+def dataloader_class
+  @dataloader_class || GraphQL::Dataloader::NullDataloader
+end
+
+
+ + + +
+

+ + .error_bubbling(new_error_bubbling = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+731
+732
+733
+734
+735
+736
+737
+
+
# File 'lib/graphql/schema.rb', line 731
+
+def error_bubbling(new_error_bubbling = nil)
+  if !new_error_bubbling.nil?
+    @error_bubbling = new_error_bubbling
+  else
+    @error_bubbling.nil? ? find_inherited_value(:error_bubbling) : @error_bubbling
+  end
+end
+
+
+ + + +
+

+ + .interpreter=(value) ⇒ Object (writeonly) + + + + + +

+
+

Sets the attribute interpreter

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + + + + + — +

    the value to set the attribute interpreter to.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+729
+730
+731
+
+
# File 'lib/graphql/schema.rb', line 729
+
+def interpreter=(value)
+  @interpreter = value
+end
+
+
+ + + +
+

+ + .max_complexity(max_complexity = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+705
+706
+707
+708
+709
+710
+711
+712
+713
+
+
# File 'lib/graphql/schema.rb', line 705
+
+def max_complexity(max_complexity = nil)
+  if max_complexity
+    @max_complexity = max_complexity
+  elsif defined?(@max_complexity)
+    @max_complexity
+  else
+    find_inherited_value(:max_complexity)
+  end
+end
+
+
+ + + +
+

+ + .max_depth(new_max_depth = nil, count_introspection_fields: true) ⇒ Object + + + + + +

+ + + + +
+
+
+
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+
+
# File 'lib/graphql/schema.rb', line 743
+
+def max_depth(new_max_depth = nil, count_introspection_fields: true)
+  if new_max_depth
+    @max_depth = new_max_depth
+    @count_introspection_fields = count_introspection_fields
+  elsif defined?(@max_depth)
+    @max_depth
+  else
+    find_inherited_value(:max_depth)
+  end
+end
+
+
+ + + +
+

+ + .validate_max_errors(new_validate_max_errors = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+693
+694
+695
+696
+697
+698
+699
+700
+701
+
+
# File 'lib/graphql/schema.rb', line 693
+
+def validate_max_errors(new_validate_max_errors = nil)
+  if new_validate_max_errors
+    @validate_max_errors = new_validate_max_errors
+  elsif defined?(@validate_max_errors)
+    @validate_max_errors
+  else
+    find_inherited_value(:validate_max_errors)
+  end
+end
+
+
+ + + +
+

+ + .validate_timeout(new_validate_timeout = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+664
+665
+666
+667
+668
+669
+670
+671
+672
+
+
# File 'lib/graphql/schema.rb', line 664
+
+def validate_timeout(new_validate_timeout = nil)
+  if new_validate_timeout
+    @validate_timeout = new_validate_timeout
+  elsif defined?(@validate_timeout)
+    @validate_timeout
+  else
+    find_inherited_value(:validate_timeout)
+  end
+end
+
+
+ + + +
+

+ + .warden_classObject + + + + + +

+ + + + +
+
+
+
+472
+473
+474
+475
+476
+477
+478
+479
+480
+
+
# File 'lib/graphql/schema.rb', line 472
+
+def warden_class
+  if defined?(@warden_class)
+    @warden_class
+  elsif superclass.respond_to?(:warden_class)
+    superclass.warden_class
+  else
+    GraphQL::Schema::Warden
+  end
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .add_subscription_extension_if_necessaryObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+
+
# File 'lib/graphql/schema.rb', line 1240
+
+def add_subscription_extension_if_necessary
+  if !defined?(@subscription_extension_added) && subscription && self.subscriptions
+    @subscription_extension_added = true
+    subscription.all_field_definitions.each do |field|
+      if !field.extensions.any? { |ext| ext.is_a?(Subscriptions::DefaultSubscriptionResolveExtension) }
+        field.extension(Subscriptions::DefaultSubscriptionResolveExtension)
+      end
+    end
+  end
+end
+
+
+ +
+

+ + .after_any_lazies(maybe_lazies) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Return a lazy if any of maybe_lazies are lazy, +otherwise, call the block eagerly and return the result.

+ + +
+
+
+

Parameters:

+
    + +
  • + + maybe_lazies + + + (Array) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+
+
# File 'lib/graphql/schema.rb', line 1299
+
+def after_any_lazies(maybe_lazies)
+  if maybe_lazies.any? { |l| lazy?(l) }
+    GraphQL::Execution::Lazy.all(maybe_lazies).then do |result|
+      yield result
+    end
+  else
+    yield maybe_lazies
+  end
+end
+
+
+ +
+

+ + .after_lazy(value, &block) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Call the given block at the right time, either: +- Right away, if value is not registered with lazy_resolve +- After resolving value, if it’s registered with lazy_resolve (eg, Promise)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+
+
# File 'lib/graphql/schema.rb', line 1259
+
+def after_lazy(value, &block)
+  if lazy?(value)
+    GraphQL::Execution::Lazy.new do
+      result = sync_lazy(value)
+      # The returned result might also be lazy, so check it, too
+      after_lazy(result, &block)
+    end
+  else
+    yield(value) if block_given?
+  end
+end
+
+
+ +
+

+ + .as_json(context: {}, include_deprecated_args: true, include_schema_description: false, include_is_repeatable: false, include_specified_by_url: false, include_is_one_of: false) ⇒ Hash + + + + + +

+
+

Return the Hash response of Introspection::INTROSPECTION_QUERY.

+ + +
+
+
+

Parameters:

+
    + +
  • + + context + + + (Hash) + + + (defaults to: {}) + + +
  • + +
  • + + only + + + (<#call(member, ctx)>) + + + +
  • + +
  • + + except + + + (<#call(member, ctx)>) + + + +
  • + +
  • + + include_deprecated_args + + + (Boolean) + + + (defaults to: true) + + + — +

    If true, deprecated arguments will be included in the JSON response

    +
    + +
  • + +
  • + + include_schema_description + + + (Boolean) + + + (defaults to: false) + + + — +

    If true, the schema’s description will be queried and included in the response

    +
    + +
  • + +
  • + + include_is_repeatable + + + (Boolean) + + + (defaults to: false) + + + — +

    If true, isRepeatable: true|false will be included with the schema’s directives

    +
    + +
  • + +
  • + + include_specified_by_url + + + (Boolean) + + + (defaults to: false) + + + — +

    If true, scalar types’ specifiedByUrl: will be included in the response

    +
    + +
  • + +
  • + + include_is_one_of + + + (Boolean) + + + (defaults to: false) + + + — +

    If true, isOneOf: true|false will be included with input objects

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    GraphQL result

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+
+
# File 'lib/graphql/schema.rb', line 265
+
+def as_json(context: {}, include_deprecated_args: true, include_schema_description: false, include_is_repeatable: false, include_specified_by_url: false, include_is_one_of: false)
+  introspection_query = Introspection.query(
+    include_deprecated_args: include_deprecated_args,
+    include_schema_description: include_schema_description,
+    include_is_repeatable: include_is_repeatable,
+    include_is_one_of: include_is_one_of,
+    include_specified_by_url: include_specified_by_url,
+  )
+
+  execute(introspection_query, context: context).to_h
+end
+
+
+ +
+

+ + .build_trace_mode(mode) ⇒ Object + + + + + +

+ + + + +
+
+
+
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+
+
# File 'lib/graphql/schema.rb', line 205
+
+def build_trace_mode(mode)
+  case mode
+  when :default
+    # Use the superclass's default mode if it has one, or else start an inheritance chain at the built-in base class.
+    base_class = (superclass.respond_to?(:trace_class_for) && superclass.trace_class_for(mode)) || GraphQL::Tracing::Trace
+    Class.new(base_class) do
+      include DefaultTraceClass
+    end
+  when :default_backtrace
+    schema_base_class = trace_class_for(:default)
+    Class.new(schema_base_class) do
+      include(GraphQL::Backtrace::Trace)
+    end
+  else
+    # First, see if the superclass has a custom-defined class for this.
+    # Then, if it doesn't, use this class's default trace
+    base_class = (superclass.respond_to?(:trace_class_for) && superclass.trace_class_for(mode, build: false)) || trace_class_for(:default)
+    # Prepare the default trace class if it hasn't been initialized yet
+    base_class ||= (own_trace_modes[:default] = build_trace_mode(:default))
+    mods = trace_modules_for(mode)
+    if base_class < DefaultTraceClass
+      mods = trace_modules_for(:default) + mods
+    end
+    Class.new(base_class) do
+      mods.any? && include(*mods)
+    end
+  end
+end
+
+
+ +
+

+ + .context_class(new_context_class = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+859
+860
+861
+862
+863
+864
+865
+
+
# File 'lib/graphql/schema.rb', line 859
+
+def context_class(new_context_class = nil)
+  if new_context_class
+    @context_class = new_context_class
+  else
+    @context_class || find_inherited_value(:context_class, GraphQL::Query::Context)
+  end
+end
+
+
+ +
+

+ + .count_introspection_fieldsObject + + + + + +

+ + + + +
+
+
+
+754
+755
+756
+757
+758
+759
+760
+
+
# File 'lib/graphql/schema.rb', line 754
+
+def count_introspection_fields
+  if defined?(@count_introspection_fields)
+    @count_introspection_fields
+  else
+    find_inherited_value(:count_introspection_fields, true)
+  end
+end
+
+
+ +
+

+ + .cursor_encoder(new_encoder = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+615
+616
+617
+618
+619
+620
+
+
# File 'lib/graphql/schema.rb', line 615
+
+def cursor_encoder(new_encoder = nil)
+  if new_encoder
+    @cursor_encoder = new_encoder
+  end
+  @cursor_encoder || find_inherited_value(:cursor_encoder, Base64Encoder)
+end
+
+
+ +
+

+ + .default_analysis_engineObject + + + + + +

+ + + + +
+
+
+
+831
+832
+833
+834
+835
+836
+837
+
+
# File 'lib/graphql/schema.rb', line 831
+
+def default_analysis_engine
+  if superclass <= GraphQL::Schema
+    superclass.default_analysis_engine
+  else
+    @default_analysis_engine ||= GraphQL::Analysis::AST
+  end
+end
+
+
+ +
+

+ + .default_directivesObject + + + + + +

+ + + + +
+
+
+
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+
+
# File 'lib/graphql/schema.rb', line 1063
+
+def default_directives
+  @default_directives ||= {
+    "include" => GraphQL::Schema::Directive::Include,
+    "skip" => GraphQL::Schema::Directive::Skip,
+    "deprecated" => GraphQL::Schema::Directive::Deprecated,
+    "oneOf" => GraphQL::Schema::Directive::OneOf,
+    "specifiedBy" => GraphQL::Schema::Directive::SpecifiedBy,
+  }.freeze
+end
+
+
+ +
+

+ + .default_execution_strategyObject + + + + + +

+ + + + +
+
+
+
+823
+824
+825
+826
+827
+828
+829
+
+
# File 'lib/graphql/schema.rb', line 823
+
+def default_execution_strategy
+  if superclass <= GraphQL::Schema
+    superclass.default_execution_strategy
+  else
+    @default_execution_strategy ||= GraphQL::Execution::Interpreter
+  end
+end
+
+
+ +
+

+ + .default_logger(new_default_logger = NOT_CONFIGURED) ⇒ Object + + + + + +

+ + + + +
+
+
+
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+
+
# File 'lib/graphql/schema.rb', line 839
+
+def default_logger(new_default_logger = NOT_CONFIGURED)
+  if NOT_CONFIGURED.equal?(new_default_logger)
+    if defined?(@default_logger)
+      @default_logger
+    elsif superclass.respond_to?(:default_logger)
+      superclass.default_logger
+    elsif defined?(Rails) && Rails.respond_to?(:logger) && (rails_logger = Rails.logger)
+      rails_logger
+    else
+      def_logger = Logger.new($stdout)
+      def_logger.info! # It doesn't output debug info by default
+      def_logger
+    end
+  elsif new_default_logger == nil
+    @default_logger = Logger.new(IO::NULL)
+  else
+    @default_logger = new_default_logger
+  end
+end
+
+
+ +
+

+ + .default_max_page_size(new_default_max_page_size = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+622
+623
+624
+625
+626
+627
+628
+
+
# File 'lib/graphql/schema.rb', line 622
+
+def default_max_page_size(new_default_max_page_size = nil)
+  if new_default_max_page_size
+    @default_max_page_size = new_default_max_page_size
+  else
+    @default_max_page_size || find_inherited_value(:default_max_page_size)
+  end
+end
+
+
+ +
+

+ + .default_page_size(new_default_page_size = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+630
+631
+632
+633
+634
+635
+636
+
+
# File 'lib/graphql/schema.rb', line 630
+
+def default_page_size(new_default_page_size = nil)
+  if new_default_page_size
+    @default_page_size = new_default_page_size
+  else
+    @default_page_size || find_inherited_value(:default_page_size)
+  end
+end
+
+
+ +
+

+ + .default_trace_mode(new_mode = nil) ⇒ Object + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + new_mode + + + (Symbol) + + + (defaults to: nil) + + + — +

    If configured, this will be used when context: { trace_mode: ... } isn’t set.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+
+
# File 'lib/graphql/schema.rb', line 151
+
+def default_trace_mode(new_mode = nil)
+  if new_mode
+    @default_trace_mode = new_mode
+  elsif defined?(@default_trace_mode)
+    @default_trace_mode
+  elsif superclass.respond_to?(:default_trace_mode)
+    superclass.default_trace_mode
+  else
+    :default
+  end
+end
+
+
+ +
+

+ + .deprecated_graphql_definitionObject + + + + + +

+ + + + +
+
+
+
+137
+138
+139
+
+
# File 'lib/graphql/schema.rb', line 137
+
+def deprecated_graphql_definition
+  graphql_definition(silence_deprecation_warning: true)
+end
+
+
+ +
+

+ + .description(new_description = nil) ⇒ String? + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+291
+292
+293
+294
+295
+296
+297
+298
+299
+
+
# File 'lib/graphql/schema.rb', line 291
+
+def description(new_description = nil)
+  if new_description
+    @description = new_description
+  elsif defined?(@description)
+    @description
+  else
+    find_inherited_value(:description, nil)
+  end
+end
+
+
+ +
+

+ + .directive(new_directive) ⇒ Object + + + + + +

+
+

Attach a single directive to this schema

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_directive + + + (Class) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + + + + + +

    void

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1059
+1060
+1061
+
+
# File 'lib/graphql/schema.rb', line 1059
+
+def directive(new_directive)
+  add_type_and_traverse(new_directive, root: false)
+end
+
+
+ +
+

+ + .directives(*new_directives) ⇒ Object + + + + + +

+
+

Add several directives at once

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_directives + + + (Class) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+
+
# File 'lib/graphql/schema.rb', line 1043
+
+def directives(*new_directives)
+  if new_directives.any?
+    new_directives.flatten.each { |d| directive(d) }
+  end
+
+  inherited_dirs = find_inherited_value(:directives, default_directives)
+  if own_directives.any?
+    inherited_dirs.merge(own_directives)
+  else
+    inherited_dirs
+  end
+end
+
+
+ +
+

+ + .disable_introspection_entry_pointsObject + + + + + +

+ + + + +
+
+
+
+762
+763
+764
+765
+766
+
+
# File 'lib/graphql/schema.rb', line 762
+
+def disable_introspection_entry_points
+  @disable_introspection_entry_points = true
+  # TODO: this clears the cache made in `def types`. But this is not a great solution.
+  @introspection_system = nil
+end
+
+
+ +
+

+ + .disable_introspection_entry_points?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+780
+781
+782
+783
+784
+785
+786
+
+
# File 'lib/graphql/schema.rb', line 780
+
+def disable_introspection_entry_points?
+  if instance_variable_defined?(:@disable_introspection_entry_points)
+    @disable_introspection_entry_points
+  else
+    find_inherited_value(:disable_introspection_entry_points?, false)
+  end
+end
+
+
+ +
+

+ + .disable_schema_introspection_entry_pointObject + + + + + +

+ + + + +
+
+
+
+768
+769
+770
+771
+772
+
+
# File 'lib/graphql/schema.rb', line 768
+
+def disable_schema_introspection_entry_point
+  @disable_schema_introspection_entry_point = true
+  # TODO: this clears the cache made in `def types`. But this is not a great solution.
+  @introspection_system = nil
+end
+
+
+ +
+

+ + .disable_schema_introspection_entry_point?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+788
+789
+790
+791
+792
+793
+794
+
+
# File 'lib/graphql/schema.rb', line 788
+
+def disable_schema_introspection_entry_point?
+  if instance_variable_defined?(:@disable_schema_introspection_entry_point)
+    @disable_schema_introspection_entry_point
+  else
+    find_inherited_value(:disable_schema_introspection_entry_point?, false)
+  end
+end
+
+
+ +
+

+ + .disable_type_introspection_entry_pointObject + + + + + +

+ + + + +
+
+
+
+774
+775
+776
+777
+778
+
+
# File 'lib/graphql/schema.rb', line 774
+
+def disable_type_introspection_entry_point
+  @disable_type_introspection_entry_point = true
+  # TODO: this clears the cache made in `def types`. But this is not a great solution.
+  @introspection_system = nil
+end
+
+
+ +
+

+ + .disable_type_introspection_entry_point?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+796
+797
+798
+799
+800
+801
+802
+
+
# File 'lib/graphql/schema.rb', line 796
+
+def disable_type_introspection_entry_point?
+  if instance_variable_defined?(:@disable_type_introspection_entry_point)
+    @disable_type_introspection_entry_point
+  else
+    find_inherited_value(:disable_type_introspection_entry_point?, false)
+  end
+end
+
+
+ +
+

+ + .error_handlersObject + + + + + +

+ + + + +
+
+
+
+881
+882
+883
+884
+885
+886
+887
+
+
# File 'lib/graphql/schema.rb', line 881
+
+def error_handlers
+  @error_handlers ||= {
+    class: nil,
+    handler: nil,
+    subclass_handlers: Hash.new(&NEW_HANDLER_HASH),
+  }
+end
+
+
+ +
+

+ + .execute(query_str = nil, **kwargs) ⇒ Hash + + + + + +

+
+

Execute a query on itself.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    query result, ready to be serialized as JSON

    +
    + +
  • + +
+ +

See Also:

+
    + +
  • for arguments.
  • + +
+ +
+ + + + +
+
+
+
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+
+
# File 'lib/graphql/schema.rb', line 1188
+
+def execute(query_str = nil, **kwargs)
+  if query_str
+    kwargs[:query] = query_str
+  end
+  # Some of the query context _should_ be passed to the multiplex, too
+  multiplex_context = if (ctx = kwargs[:context])
+    {
+      backtrace: ctx[:backtrace],
+      tracers: ctx[:tracers],
+      trace: ctx[:trace],
+      dataloader: ctx[:dataloader],
+      trace_mode: ctx[:trace_mode],
+    }
+  else
+    {}
+  end
+  # Since we're running one query, don't run a multiplex-level complexity analyzer
+  all_results = multiplex([kwargs], max_complexity: nil, context: multiplex_context)
+  all_results[0]
+end
+
+
+ +
+

+ + .find(path) ⇒ Object + + + + + +

+ + + + +
+
+
+
+301
+302
+303
+304
+305
+306
+307
+
+
# File 'lib/graphql/schema.rb', line 301
+
+def find(path)
+  if !@finder
+    @find_cache = {}
+    @finder ||= GraphQL::Schema::Finder.new(self)
+  end
+  @find_cache[path] ||= @finder.find(path)
+end
+
+
+ +
+

+ + .from_definition(definition_or_path, default_resolve: nil, parser: GraphQL.default_parser, using: {}) ⇒ Class + + + + + +

+
+

Create schema from an IDL schema or file containing an IDL definition.

+ + +
+
+
+

Parameters:

+
    + +
  • + + definition_or_path + + + (String) + + + + — +

    A schema definition string, or a path to a file containing the definition

    +
    + +
  • + +
  • + + default_resolve + + + (<#call(type, field, obj, args, ctx)>) + + + (defaults to: nil) + + + — +

    A callable for handling field resolution

    +
    + +
  • + +
  • + + parser + + + (Object) + + + (defaults to: GraphQL.default_parser) + + + — +

    An object for handling definition string parsing (must respond to parse)

    +
    + +
  • + +
  • + + using + + + (Hash) + + + (defaults to: {}) + + + — +

    Plugins to attach to the created schema with use(key, value)

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    the schema described by document

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+
+
# File 'lib/graphql/schema.rb', line 116
+
+def from_definition(definition_or_path, default_resolve: nil, parser: GraphQL.default_parser, using: {})
+  # If the file ends in `.graphql` or `.graphqls`, treat it like a filepath
+  if definition_or_path.end_with?(".graphql") || definition_or_path.end_with?(".graphqls")
+    GraphQL::Schema::BuildFromDefinition.from_definition_path(
+      self,
+      definition_or_path,
+      default_resolve: default_resolve,
+      parser: parser,
+      using: using,
+    )
+  else
+    GraphQL::Schema::BuildFromDefinition.from_definition(
+      self,
+      definition_or_path,
+      default_resolve: default_resolve,
+      parser: parser,
+      using: using,
+    )
+  end
+end
+
+
+ +
+

+ + .from_introspection(introspection_result) ⇒ Class<GraphQL::Schema> + + + + + +

+
+

Create schema with the result of an introspection query.

+ + +
+
+
+

Parameters:

+ + +

Returns:

+
    + +
  • + + + (Class<GraphQL::Schema>) + + + + — +

    the schema described by input

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+106
+107
+108
+
+
# File 'lib/graphql/schema.rb', line 106
+
+def from_introspection(introspection_result)
+  GraphQL::Schema::Loader.load(introspection_result)
+end
+
+
+ +
+

+ + .get_field(type_or_name, field_name, context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+ + + + +
+
+
+
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+
+
# File 'lib/graphql/schema.rb', line 570
+
+def get_field(type_or_name, field_name, context = GraphQL::Query::NullContext.instance)
+  parent_type = case type_or_name
+  when LateBoundType
+    get_type(type_or_name.name, context)
+  when String
+    get_type(type_or_name, context)
+  when Module
+    type_or_name
+  else
+    raise GraphQL::InvariantError, "Unexpected field owner for #{field_name.inspect}: #{type_or_name.inspect} (#{type_or_name.class})"
+  end
+
+  if parent_type.kind.fields? && (field = parent_type.get_field(field_name, context))
+    field
+  elsif parent_type == query && (entry_point_field = introspection_system.entry_point(name: field_name))
+    entry_point_field
+  elsif (dynamic_field = introspection_system.dynamic_field(name: field_name))
+    dynamic_field
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + .get_fields(type, context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+ + + + +
+
+
+
+593
+594
+595
+
+
# File 'lib/graphql/schema.rb', line 593
+
+def get_fields(type, context = GraphQL::Query::NullContext.instance)
+  type.fields(context)
+end
+
+
+ +
+

+ + .get_type(type_name, context = GraphQL::Query::NullContext.instance) ⇒ Module? + + + + + +

+
+

Returns A type, or nil if there’s no type called type_name.

+ + +
+
+
+

Parameters:

+
    + +
  • + + type_name + + + (String) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Module, nil) + + + + — +

    A type, or nil if there’s no type called type_name

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+
+
# File 'lib/graphql/schema.rb', line 356
+
+def get_type(type_name, context = GraphQL::Query::NullContext.instance)
+  local_entry = own_types[type_name]
+  type_defn = case local_entry
+  when nil
+    nil
+  when Array
+    visible_t = nil
+    warden = Warden.from_context(context)
+    local_entry.each do |t|
+      if warden.visible_type?(t, context)
+        if visible_t.nil?
+          visible_t = t
+        else
+          raise DuplicateNamesError.new(
+            duplicated_name: type_name, duplicated_definition_1: visible_t.inspect, duplicated_definition_2: t.inspect
+          )
+        end
+      end
+    end
+    visible_t
+  when Module
+    local_entry
+  else
+    raise "Invariant: unexpected own_types[#{type_name.inspect}]: #{local_entry.inspect}"
+  end
+
+  type_defn ||
+    introspection_system.types[type_name] || # todo context-specific introspection?
+    (superclass.respond_to?(:get_type) ? superclass.get_type(type_name, context) : nil)
+end
+
+
+ +
+

+ + .handle_or_reraise(context, err) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+
+
# File 'lib/graphql/schema.rb', line 890
+
+def handle_or_reraise(context, err)
+  handler = Execution::Errors.find_handler_for(self, err.class)
+  if handler
+    obj = context[:current_object]
+    args = context[:current_arguments]
+    args = args && args.respond_to?(:keyword_arguments) ? args.keyword_arguments : nil
+    field = context[:current_field]
+    if obj.is_a?(GraphQL::Schema::Object)
+      obj = obj.object
+    end
+    handler[:handler].call(err, obj, args, context, field)
+  else
+    raise err
+  end
+end
+
+
+ +
+

+ + .id_from_object(object, type, ctx) ⇒ Object + + + + + +

+
+ + + +
+
+
+ +

Raises:

+ + +
+ + + + +
+
+
+
+960
+961
+962
+
+
# File 'lib/graphql/schema.rb', line 960
+
+def id_from_object(object, type, ctx)
+  raise GraphQL::RequiredImplementationMissingError, "#{self.name}.id_from_object(object, type, ctx) must be implemented to create global ids (tried to create an id for `#{object.inspect}`)"
+end
+
+
+ +
+

+ + .inherited(child_class) ⇒ Object + + + + + +

+
+

rubocop:enable Lint/DuplicateMethods

+ + +
+
+
+ + +
+ + + + +
+
+
+
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+
+
# File 'lib/graphql/schema.rb', line 942
+
+def inherited(child_class)
+  if self == GraphQL::Schema
+    child_class.directives(default_directives.values)
+    child_class.extend(SubclassGetReferencesTo)
+  end
+  # Make sure the child class has these built out, so that
+  # subclasses can be modified by later calls to `trace_with`
+  own_trace_modes.each do |name, _class|
+    child_class.own_trace_modes[name] = child_class.build_trace_mode(name)
+  end
+  child_class.singleton_class.prepend(ResolveTypeWithType)
+  super
+end
+
+
+ +
+

+ + .instrument(instrument_step, instrumenter, options = {}) ⇒ Object + + + + + +

+ + + + +
+
+
+
+1037
+1038
+1039
+
+
# File 'lib/graphql/schema.rb', line 1037
+
+def instrument(instrument_step, instrumenter, options = {})
+  own_instrumenters[instrument_step] << instrumenter
+end
+
+
+ +
+

+ + .instrumentersObject + + + + + +

+ + + + +
+
+
+
+1232
+1233
+1234
+1235
+1236
+1237
+
+
# File 'lib/graphql/schema.rb', line 1232
+
+def instrumenters
+  inherited_instrumenters = find_inherited_value(:instrumenters) || Hash.new { |h,k| h[k] = [] }
+  inherited_instrumenters.merge(own_instrumenters) do |_step, inherited, own|
+    inherited + own
+  end
+end
+
+
+ +
+

+ + .interpreter?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+725
+726
+727
+
+
# File 'lib/graphql/schema.rb', line 725
+
+def interpreter?
+  true
+end
+
+
+ +
+

+ + .introspection(new_introspection_namespace = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+597
+598
+599
+600
+601
+602
+603
+604
+605
+
+
# File 'lib/graphql/schema.rb', line 597
+
+def introspection(new_introspection_namespace = nil)
+  if new_introspection_namespace
+    @introspection = new_introspection_namespace
+    # reset this cached value:
+    @introspection_system = nil
+  else
+    @introspection || find_inherited_value(:introspection)
+  end
+end
+
+
+ +
+

+ + .introspection_systemObject + + + + + +

+ + + + +
+
+
+
+607
+608
+609
+610
+611
+612
+613
+
+
# File 'lib/graphql/schema.rb', line 607
+
+def introspection_system
+  if !@introspection_system
+    @introspection_system = Schema::IntrospectionSystem.new(self)
+    @introspection_system.resolve_late_bindings
+  end
+  @introspection_system
+end
+
+
+ +
+

+ + .lazy?(obj) ⇒ Boolean + + + + + +

+
+

Returns True if this object should be lazily resolved.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if this object should be lazily resolved

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1291
+1292
+1293
+
+
# File 'lib/graphql/schema.rb', line 1291
+
+def lazy?(obj)
+  !!lazy_method_name(obj)
+end
+
+
+ +
+

+ + .lazy_method_name(obj) ⇒ Symbol? + + + + + +

+
+

Returns The method name to lazily resolve obj, or nil if obj’s class wasn’t registered with #lazy_resolve.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Symbol, nil) + + + + — +

    The method name to lazily resolve obj, or nil if obj’s class wasn’t registered with #lazy_resolve.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1286
+1287
+1288
+
+
# File 'lib/graphql/schema.rb', line 1286
+
+def lazy_method_name(obj)
+  lazy_methods.get(obj)
+end
+
+
+ +
+

+ + .lazy_resolve(lazy_class, value_method) ⇒ Object + + + + + +

+ + + + +
+
+
+
+1033
+1034
+1035
+
+
# File 'lib/graphql/schema.rb', line 1033
+
+def lazy_resolve(lazy_class, value_method)
+  lazy_methods.set(lazy_class, value_method)
+end
+
+
+ +
+

+ + .multiplex(queries, **kwargs) ⇒ Array<Hash> + + + + + +

+
+

Execute several queries on itself, concurrently.

+ + +
+
+
+ +
+

Examples:

+ + +

Run several queries at once

+

+ +
context = { ... }
+queries = [
+  { query: params[:query_1], variables: params[:variables_1], context: context },
+  { query: params[:query_2], variables: params[:variables_2], context: context },
+]
+results = MySchema.multiplex(queries)
+render json: {
+  result_1: results[0],
+  result_2: results[1],
+}
+ +
+

Parameters:

+
    + +
  • + + queries + + + (Array<Hash>) + + + + — +

    Keyword arguments for each query

    +
    + +
  • + +
  • + + context + + + (Hash) + + + + — +

    Multiplex-level context

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array<Hash>) + + + + — +

    One result for each query in the input

    +
    + +
  • + +
+ +

See Also:

+
    + +
  • for query keyword arguments
  • + +
  • for multiplex keyword arguments
  • + +
+ +
+ + + + +
+
+
+
+1228
+1229
+1230
+
+
# File 'lib/graphql/schema.rb', line 1228
+
+def multiplex(queries, **kwargs)
+  GraphQL::Execution::Interpreter.run_all(self, queries, **kwargs)
+end
+
+
+ +
+

+ + .multiplex_analyzer(new_analyzer) ⇒ Object + + + + + +

+ + + + +
+
+
+
+1169
+1170
+1171
+
+
# File 'lib/graphql/schema.rb', line 1169
+
+def multiplex_analyzer(new_analyzer)
+  own_multiplex_analyzers << new_analyzer
+end
+
+
+ +
+

+ + .multiplex_analyzersObject + + + + + +

+ + + + +
+
+
+
+1173
+1174
+1175
+
+
# File 'lib/graphql/schema.rb', line 1173
+
+def multiplex_analyzers
+  find_inherited_value(:multiplex_analyzers, EMPTY_ARRAY) + own_multiplex_analyzers
+end
+
+
+ +
+

+ + .mutation(new_mutation_object = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+
+
# File 'lib/graphql/schema.rb', line 424
+
+def mutation(new_mutation_object = nil)
+  if new_mutation_object
+    if @mutation_object
+      raise GraphQL::Error, "Second definition of `mutation(...)` (#{new_mutation_object.inspect}) is invalid, already configured with #{@mutation_object.inspect}"
+    else
+      @mutation_object = new_mutation_object
+      add_type_and_traverse(new_mutation_object, root: true)
+      nil
+    end
+  else
+    @mutation_object || find_inherited_value(:mutation)
+  end
+end
+
+
+ +
+

+ + .mutation_execution_strategy(new_mutation_execution_strategy = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+646
+647
+648
+649
+650
+651
+652
+
+
# File 'lib/graphql/schema.rb', line 646
+
+def mutation_execution_strategy(new_mutation_execution_strategy = nil)
+  if new_mutation_execution_strategy
+    @mutation_execution_strategy = new_mutation_execution_strategy
+  else
+    @mutation_execution_strategy || find_inherited_value(:mutation_execution_strategy, self.default_execution_strategy)
+  end
+end
+
+
+ +
+

+ + .new_connections?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+406
+407
+408
+
+
# File 'lib/graphql/schema.rb', line 406
+
+def new_connections?
+  !!connections
+end
+
+
+ +
+

+ + .new_trace(mode: nil, **options) ⇒ Tracing::Trace + + + + + +

+
+

Create a trace instance which will include the trace modules specified for the optional mode.

+ +

If no mode: is given, then default_trace_mode will be used.

+ + +
+
+
+

Parameters:

+
    + +
  • + + mode + + + (Symbol) + + + (defaults to: nil) + + + — +

    Trace modules for this trade mode will be included

    +
    + +
  • + +
  • + + options + + + (Hash) + + + + — +

    Keywords that will be passed to the tracing class during #initialize

    +
    + +
  • + +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+
+
# File 'lib/graphql/schema.rb', line 1138
+
+def new_trace(mode: nil, **options)
+  target = options[:query] || options[:multiplex]
+  mode ||= target && target.context[:trace_mode]
+
+  trace_mode = if mode
+    mode
+  elsif target && target.context[:backtrace]
+    if default_trace_mode != :default
+      raise ArgumentError, "Can't use `context[:backtrace]` with a custom default trace mode (`#{dm.inspect}`)"
+    else
+      own_trace_modes[:default_backtrace] ||= build_trace_mode(:default_backtrace)
+      :default_backtrace
+    end
+  else
+    default_trace_mode
+  end
+
+  base_trace_options = trace_options_for(trace_mode)
+  trace_options = base_trace_options.merge(options)
+  trace_class_for_mode = trace_class_for(trace_mode) || raise(ArgumentError, "#{self} has no trace class for mode: #{trace_mode.inspect}")
+  trace_class_for_mode.new(**trace_options)
+end
+
+
+ +
+

+ + .object_from_id(node_id, ctx) ⇒ Object + + + + + +

+
+ + + +
+
+
+ +

Raises:

+ + +
+ + + + +
+
+
+
+956
+957
+958
+
+
# File 'lib/graphql/schema.rb', line 956
+
+def object_from_id(node_id, ctx)
+  raise GraphQL::RequiredImplementationMissingError, "#{self.name}.object_from_id(node_id, ctx) must be implemented to load by ID (tried to load from id `#{node_id}`)"
+end
+
+
+ +
+

+ + .orphan_types(*new_orphan_types) ⇒ Object + + + + + +

+ + + + +
+
+
+
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+
+
# File 'lib/graphql/schema.rb', line 804
+
+def orphan_types(*new_orphan_types)
+  if new_orphan_types.any?
+    new_orphan_types = new_orphan_types.flatten
+    add_type_and_traverse(new_orphan_types, root: false)
+    own_orphan_types.concat(new_orphan_types.flatten)
+  end
+
+  inherited_ot = find_inherited_value(:orphan_types, nil)
+  if inherited_ot
+    if own_orphan_types.any?
+      inherited_ot + own_orphan_types
+    else
+      inherited_ot
+    end
+  else
+    own_orphan_types
+  end
+end
+
+
+ +
+

+ + .own_trace_modesObject + + + + + +

+ + + + +
+
+
+
+196
+197
+198
+
+
# File 'lib/graphql/schema.rb', line 196
+
+def own_trace_modes
+  @own_trace_modes ||= {}
+end
+
+
+ +
+

+ + .own_trace_modulesObject + + + + + +

+ + + + +
+
+
+
+234
+235
+236
+
+
# File 'lib/graphql/schema.rb', line 234
+
+def own_trace_modules
+  @own_trace_modules ||= Hash.new { |h, k| h[k] = [] }
+end
+
+
+ +
+

+ + .parse_error(parse_err, ctx) ⇒ Object + + + + + +

+
+

A function to call when #execute receives an invalid query string

+ +

The default is to add the error to context.errors

+ + +
+
+
+

Parameters:

+
    + +
  • + + parse_err + + + (GraphQL::ParseError) + + + + — +

    The error encountered during parsing

    +
    + +
  • + +
  • + + ctx + + + (GraphQL::Query::Context) + + + + — +

    The context for the query where the error occurred

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + + + + + +

    void

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1029
+1030
+1031
+
+
# File 'lib/graphql/schema.rb', line 1029
+
+def parse_error(parse_err, ctx)
+  ctx.errors.push(parse_err)
+end
+
+
+ +
+

+ + .pluginsObject + + + + + +

+ + + + +
+
+
+
+322
+323
+324
+
+
# File 'lib/graphql/schema.rb', line 322
+
+def plugins
+  find_inherited_value(:plugins, EMPTY_ARRAY) + own_plugins
+end
+
+
+ +
+

+ + .possible_types(type = nil, context = GraphQL::Query::NullContext.instance) ⇒ Hash<String, Module>, Array<Module> + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + type + + + (Module) + + + (defaults to: nil) + + + — +

    The type definition whose possible types you want to see

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash<String, Module>) + + + + — +

    All possible types, if no type is given.

    +
    + +
  • + +
  • + + + (Array<Module>) + + + + — +

    Possible types for type, if it’s given.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+
+
# File 'lib/graphql/schema.rb', line 487
+
+def possible_types(type = nil, context = GraphQL::Query::NullContext.instance)
+  if type
+    # TODO duck-typing `.possible_types` would probably be nicer here
+    if type.kind.union?
+      type.possible_types(context: context)
+    else
+      stored_possible_types = own_possible_types[type.graphql_name]
+      visible_possible_types = if stored_possible_types && type.kind.interface?
+        stored_possible_types.select do |possible_type|
+          possible_type.interfaces(context).include?(type)
+        end
+      else
+        stored_possible_types
+      end
+      visible_possible_types ||
+        introspection_system.possible_types[type.graphql_name] ||
+        (
+          superclass.respond_to?(:possible_types) ?
+            superclass.possible_types(type, context) :
+            EMPTY_ARRAY
+        )
+    end
+  else
+    find_inherited_value(:possible_types, EMPTY_HASH)
+      .merge(own_possible_types)
+      .merge(introspection_system.possible_types)
+  end
+end
+
+
+ +
+

+ + .query(new_query_object = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+
+
# File 'lib/graphql/schema.rb', line 410
+
+def query(new_query_object = nil)
+  if new_query_object
+    if @query_object
+      raise GraphQL::Error, "Second definition of `query(...)` (#{new_query_object.inspect}) is invalid, already configured with #{@query_object.inspect}"
+    else
+      @query_object = new_query_object
+      add_type_and_traverse(new_query_object, root: true)
+      nil
+    end
+  else
+    @query_object || find_inherited_value(:query)
+  end
+end
+
+
+ +
+

+ + .query_analyzer(new_analyzer) ⇒ Object + + + + + +

+ + + + +
+
+
+
+1161
+1162
+1163
+
+
# File 'lib/graphql/schema.rb', line 1161
+
+def query_analyzer(new_analyzer)
+  own_query_analyzers << new_analyzer
+end
+
+
+ +
+

+ + .query_analyzersObject + + + + + +

+ + + + +
+
+
+
+1165
+1166
+1167
+
+
# File 'lib/graphql/schema.rb', line 1165
+
+def query_analyzers
+  find_inherited_value(:query_analyzers, EMPTY_ARRAY) + own_query_analyzers
+end
+
+
+ +
+

+ + .query_execution_strategy(new_query_execution_strategy = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+638
+639
+640
+641
+642
+643
+644
+
+
# File 'lib/graphql/schema.rb', line 638
+
+def query_execution_strategy(new_query_execution_strategy = nil)
+  if new_query_execution_strategy
+    @query_execution_strategy = new_query_execution_strategy
+  else
+    @query_execution_strategy || find_inherited_value(:query_execution_strategy, self.default_execution_strategy)
+  end
+end
+
+
+ +
+

+ + .query_stack_error(query, err) ⇒ Object + + + + + +

+ + + + +
+
+
+
+1251
+1252
+1253
+
+
# File 'lib/graphql/schema.rb', line 1251
+
+def query_stack_error(query, err)
+  query.context.errors.push(GraphQL::ExecutionError.new("This query is too large to execute."))
+end
+
+
+ +
+

+ + .references_to(to_type = nil, from: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+
+
# File 'lib/graphql/schema.rb', line 539
+
+def references_to(to_type = nil, from: nil)
+  @own_references_to ||= {}
+  if to_type
+    if !to_type.is_a?(String)
+      to_type = to_type.graphql_name
+    end
+
+    if from
+      refs = @own_references_to[to_type] ||= []
+      refs << from
+    else
+      get_references_to(to_type) || EMPTY_ARRAY
+    end
+  else
+    # `@own_references_to` can be quite large for big schemas,
+    # and generally speaking, we won't inherit any values.
+    # So optimize the most common case -- don't create a duplicate Hash.
+    inherited_value = find_inherited_value(:references_to, EMPTY_HASH)
+    if inherited_value.any?
+      inherited_value.merge(@own_references_to)
+    else
+      @own_references_to
+    end
+  end
+end
+
+
+ +
+

+ + .rescue_from(*err_classes, &handler_block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+867
+868
+869
+870
+871
+
+
# File 'lib/graphql/schema.rb', line 867
+
+def rescue_from(*err_classes, &handler_block)
+  err_classes.each do |err_class|
+    Execution::Errors.register_rescue_from(err_class, error_handlers[:subclass_handlers], handler_block)
+  end
+end
+
+
+ +
+

+ + .resolve_type(type, obj, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+933
+934
+935
+936
+937
+938
+939
+
+
# File 'lib/graphql/schema.rb', line 933
+
+def resolve_type(type, obj, ctx)
+  if type.kind.object?
+    type
+  else
+    raise GraphQL::RequiredImplementationMissingError, "#{self.name}.resolve_type(type, obj, ctx) must be implemented to use Union types or Interface types (tried to resolve: #{type.name})"
+  end
+end
+
+
+ +
+

+ + .root_type_for_operation(operation) ⇒ GraphQL::ObjectType? + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::ObjectType, nil) + + + +
  • + +
+ +

See Also:

+
    + +
  • Restricted access to root types
  • + +
+ +
+ + + + +
+
+
+
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+
+
# File 'lib/graphql/schema.rb', line 455
+
+def root_type_for_operation(operation)
+  case operation
+  when "query"
+    query
+  when "mutation"
+    mutation
+  when "subscription"
+    subscription
+  else
+    raise ArgumentError, "unknown operation type: #{operation}"
+  end
+end
+
+
+ +
+

+ + .root_typesObject + + + + + +

+ + + + +
+
+
+
+468
+469
+470
+
+
# File 'lib/graphql/schema.rb', line 468
+
+def root_types
+  @root_types
+end
+
+
+ +
+

+ + .sanitized_printer(new_sanitized_printer = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+
+
# File 'lib/graphql/schema.rb', line 1177
+
+def sanitized_printer(new_sanitized_printer = nil)
+  if new_sanitized_printer
+    @own_sanitized_printer = new_sanitized_printer
+  else
+    @own_sanitized_printer || GraphQL::Language::SanitizedPrinter
+  end
+end
+
+
+ +
+

+ + .schema_directive(dir_class, **options) ⇒ Object + + + + + +

+ + + + +
+
+
+
+968
+969
+970
+971
+
+
# File 'lib/graphql/schema.rb', line 968
+
+def schema_directive(dir_class, **options)
+  @own_schema_directives ||= []
+  Member::HasDirectives.add_directive(self, @own_schema_directives, dir_class, options)
+end
+
+
+ +
+

+ + .schema_directivesObject + + + + + +

+ + + + +
+
+
+
+973
+974
+975
+
+
# File 'lib/graphql/schema.rb', line 973
+
+def schema_directives
+  Member::HasDirectives.get_directives(self, @own_schema_directives, :schema_directives)
+end
+
+
+ +
+

+ + .static_validatorObject + + + + + +

+ + + + +
+
+
+
+309
+310
+311
+
+
# File 'lib/graphql/schema.rb', line 309
+
+def static_validator
+  GraphQL::StaticValidation::Validator.new(schema: self)
+end
+
+
+ +
+

+ + .subscription(new_subscription_object = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+
+
# File 'lib/graphql/schema.rb', line 438
+
+def subscription(new_subscription_object = nil)
+  if new_subscription_object
+    if @subscription_object
+      raise GraphQL::Error, "Second definition of `subscription(...)` (#{new_subscription_object.inspect}) is invalid, already configured with #{@subscription_object.inspect}"
+    else
+      @subscription_object = new_subscription_object
+      add_subscription_extension_if_necessary
+      add_type_and_traverse(new_subscription_object, root: true)
+      nil
+    end
+  else
+    @subscription_object || find_inherited_value(:subscription)
+  end
+end
+
+
+ +
+

+ + .subscription_execution_strategy(new_subscription_execution_strategy = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+654
+655
+656
+657
+658
+659
+660
+
+
# File 'lib/graphql/schema.rb', line 654
+
+def subscription_execution_strategy(new_subscription_execution_strategy = nil)
+  if new_subscription_execution_strategy
+    @subscription_execution_strategy = new_subscription_execution_strategy
+  else
+    @subscription_execution_strategy || find_inherited_value(:subscription_execution_strategy, self.default_execution_strategy)
+  end
+end
+
+
+ +
+

+ + .subscriptions(inherited: true) ⇒ GraphQL::Subscriptions + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+142
+143
+144
+
+
# File 'lib/graphql/schema.rb', line 142
+
+def subscriptions(inherited: true)
+  defined?(@subscriptions) ? @subscriptions : (inherited ? find_inherited_value(:subscriptions, nil) : nil)
+end
+
+
+ +
+

+ + .subscriptions=(new_implementation) ⇒ Object + + + + + +

+ + + + +
+
+
+
+146
+147
+148
+
+
# File 'lib/graphql/schema.rb', line 146
+
+def subscriptions=(new_implementation)
+  @subscriptions = new_implementation
+end
+
+
+ +
+

+ + .sync_lazy(value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Override this method to handle lazy objects in a custom way.

+ + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Object) + + + + — +

    an instance of a class registered with lazy_resolve

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    A GraphQL-ready (non-lazy) object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+
+
# File 'lib/graphql/schema.rb', line 1275
+
+def sync_lazy(value)
+  lazy_method = lazy_method_name(value)
+  if lazy_method
+    synced_value = value.public_send(lazy_method)
+    sync_lazy(synced_value)
+  else
+    value
+  end
+end
+
+
+ +
+

+ + .to_definition(context: {}) ⇒ String + + + + + +

+
+

Return the GraphQL IDL for the schema

+ + +
+
+
+

Parameters:

+
    + +
  • + + context + + + (Hash) + + + (defaults to: {}) + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+280
+281
+282
+
+
# File 'lib/graphql/schema.rb', line 280
+
+def to_definition(context: {})
+  GraphQL::Schema::Printer.print_schema(self, context: context)
+end
+
+
+ +
+

+ + .to_documentGraphQL::Language::Document + + + + + +

+
+

Return the GraphQL::Language::Document IDL AST for the schema

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Language::Document) + + + +
  • + +
+ +
+ + + + +
+
+
+
+286
+287
+288
+
+
# File 'lib/graphql/schema.rb', line 286
+
+def to_document
+  GraphQL::Language::DocumentFromSchemaDefinition.new(self).document
+end
+
+
+ +
+

+ + .to_json(**args) ⇒ String + + + + + +

+
+

Returns the JSON response of Introspection::INTROSPECTION_QUERY.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +

See Also:

+
    + +
  • {{#as_json}
  • + +
+ +
+ + + + +
+
+
+
+251
+252
+253
+
+
# File 'lib/graphql/schema.rb', line 251
+
+def to_json(**args)
+  JSON.pretty_generate(as_json(**args))
+end
+
+
+ +
+

+ + .trace_class(new_class = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+163
+164
+165
+166
+167
+168
+169
+170
+171
+
+
# File 'lib/graphql/schema.rb', line 163
+
+def trace_class(new_class = nil)
+  if new_class
+    trace_mode(:default, new_class)
+    backtrace_class = Class.new(new_class)
+    backtrace_class.include(GraphQL::Backtrace::Trace)
+    trace_mode(:default_backtrace, backtrace_class)
+  end
+  trace_class_for(:default)
+end
+
+
+ +
+

+ + .trace_class_for(mode, build: true) ⇒ Class + + + + + +

+
+

Return the trace class to use for this mode, looking one up on the superclass if this Schema doesn’t have one defined.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    Return the trace class to use for this mode, looking one up on the superclass if this Schema doesn’t have one defined.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+174
+175
+176
+177
+
+
# File 'lib/graphql/schema.rb', line 174
+
+def trace_class_for(mode, build: true)
+  own_trace_modes[mode] ||
+    (superclass.respond_to?(:trace_class_for) ? superclass.trace_class_for(mode, build: build) : (build ? (own_trace_modes[mode] = build_trace_mode(mode)) : nil))
+end
+
+
+ +
+

+ + .trace_mode(mode_name, trace_class) ⇒ Object + + + + + +

+
+

Configure trace_class to be used whenever context: { trace_mode: mode_name } is requested. +default_trace_mode is used when no trace_mode: ... is requested.

+ +

When a trace_class is added this way, it will not receive other modules added with trace_with(...) +unless trace_mode is explicitly given. (This class will not recieve any default trace modules.)

+ +

Subclasses of the schema will use trace_class as a base class for this mode and those +subclass also will not receive default tracing modules.

+ + +
+
+
+

Parameters:

+
    + +
  • + + mode_name + + + (Symbol) + + + +
  • + +
  • + + trace_class + + + (Class) + + + + — +

    subclass of GraphQL::Tracing::Trace

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + + + + + +

    void

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+191
+192
+193
+194
+
+
# File 'lib/graphql/schema.rb', line 191
+
+def trace_mode(mode_name, trace_class)
+  own_trace_modes[mode_name] = trace_class
+  nil
+end
+
+
+ +
+

+ + .trace_modules_for(trace_mode) ⇒ Array<Module> + + + + + +

+
+

Returns Modules added for tracing in trace_mode, including inherited ones.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Module>) + + + + — +

    Modules added for tracing in trace_mode, including inherited ones

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+239
+240
+241
+242
+243
+244
+245
+
+
# File 'lib/graphql/schema.rb', line 239
+
+def trace_modules_for(trace_mode)
+  modules = own_trace_modules[trace_mode]
+  if superclass.respond_to?(:trace_modules_for)
+    modules += superclass.trace_modules_for(trace_mode)
+  end
+  modules
+end
+
+
+ +
+

+ + .trace_options_for(mode) ⇒ Hash + + + + + +

+
+

The options hash for this trace mode

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + +
  • + +
+ +
+ + + + +
+
+
+
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+
+
# File 'lib/graphql/schema.rb', line 1120
+
+def trace_options_for(mode)
+  @trace_options_for_mode ||= {}
+  @trace_options_for_mode[mode] ||= begin
+    if superclass.respond_to?(:trace_options_for)
+      superclass.trace_options_for(mode).dup
+    else
+      {}
+    end
+  end
+end
+
+
+ +
+

+ + .trace_with(trace_mod, mode: :default, **options) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Mix trace_mod into this schema’s Trace class so that its methods +will be called at runtime.

+ + +
+
+
+

Parameters:

+
    + +
  • + + trace_mod + + + (Module) + + + + — +

    A module that implements tracing methods

    +
    + +
  • + +
  • + + mode + + + (Symbol) + + + (defaults to: :default) + + + — +

    Trace module will only be used for this trade mode

    +
    + +
  • + +
  • + + options + + + (Hash) + + + + — +

    Keywords that will be passed to the tracing class during #initialize

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+
+
# File 'lib/graphql/schema.rb', line 1093
+
+def trace_with(trace_mod, mode: :default, **options)
+  if mode.is_a?(Array)
+    mode.each { |m| trace_with(trace_mod, mode: m, **options) }
+  else
+    tc = own_trace_modes[mode] ||= build_trace_mode(mode)
+    tc.include(trace_mod)
+    own_trace_modules[mode] << trace_mod
+
+    if mode == :default
+      # This module is being added as a default tracer. If any other mode classes
+      # have already been created, but get their default behavior from a superclass,
+      # Then mix this into this schema's subclass.
+      # (But don't mix it into mode classes that aren't default-based.)
+      own_trace_modes.each do |other_mode_name, other_mode_class|
+        if other_mode_class < DefaultTraceClass && !(other_mode_class < trace_mod)
+          other_mode_class.include(trace_mod)
+        end
+      end
+    end
+    t_opts = trace_options_for(mode)
+    t_opts.merge!(options)
+  end
+  nil
+end
+
+
+ +
+

+ + .tracer(new_tracer) ⇒ Object + + + + + +

+ + + + +
+
+
+
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+
+
# File 'lib/graphql/schema.rb', line 1073
+
+def tracer(new_tracer)
+  default_trace = trace_class_for(:default)
+  if default_trace.nil? || !(default_trace < GraphQL::Tracing::CallLegacyTracers)
+    trace_with(GraphQL::Tracing::CallLegacyTracers)
+  end
+
+  own_tracers << new_tracer
+end
+
+
+ +
+

+ + .tracersObject + + + + + +

+ + + + +
+
+
+
+1082
+1083
+1084
+
+
# File 'lib/graphql/schema.rb', line 1082
+
+def tracers
+  find_inherited_value(:tracers, EMPTY_ARRAY) + own_tracers
+end
+
+
+ +
+

+ + .type_error(type_error, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+
+
# File 'lib/graphql/schema.rb', line 1012
+
+def type_error(type_error, ctx)
+  case type_error
+  when GraphQL::InvalidNullError
+    ctx.errors << type_error
+  when GraphQL::UnresolvedTypeError, GraphQL::StringEncodingError, GraphQL::IntegerEncodingError
+    raise type_error
+  when GraphQL::IntegerDecodingError
+    nil
+  end
+end
+
+
+ +
+

+ + .type_from_ast(ast_node, context: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+565
+566
+567
+568
+
+
# File 'lib/graphql/schema.rb', line 565
+
+def type_from_ast(ast_node, context: nil)
+  type_owner = context ? context.warden : self
+  GraphQL::Schema::TypeExpression.build_type(type_owner, ast_node)
+end
+
+
+ +
+

+ + .types(context = GraphQL::Query::NullContext.instance) ⇒ Hash<String => Class> + + + + + +

+
+

Build a map of { name => type } and return it

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<String => Class>) + + + + — +

    A dictionary of type classes by their GraphQL name

    +
    + +
  • + +
+ +

See Also:

+ + +
+ + + + +
+
+
+
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+
+
# File 'lib/graphql/schema.rb', line 329
+
+def types(context = GraphQL::Query::NullContext.instance)
+  all_types = non_introspection_types.merge(introspection_system.types)
+  visible_types = {}
+  all_types.each do |k, v|
+    visible_types[k] =if v.is_a?(Array)
+      visible_t = nil
+      v.each do |t|
+        if t.visible?(context)
+          if visible_t.nil?
+            visible_t = t
+          else
+            raise DuplicateNamesError.new(
+              duplicated_name: k, duplicated_definition_1: visible_t.inspect, duplicated_definition_2: t.inspect
+            )
+          end
+        end
+      end
+      visible_t
+    else
+      v
+    end
+  end
+  visible_types
+end
+
+
+ +
+

+ + .unauthorized_field(unauthorized_error) ⇒ Field + + + + + +

+
+

This hook is called when a field fails an authorized? check.

+ +

By default, this hook implements the same behavior as unauthorized_object.

+ +

Whatever value is returned from this method will be used instead of the +unauthorized field . If an error is raised, then nil will be used.

+ +

If you want to add an error to the "errors" key, raise a ExecutionError +in this hook.

+ + +
+
+
+

Parameters:

+ + +

Returns:

+
    + +
  • + + + (Field) + + + + — +

    The returned field will be put in the GraphQL response

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+1008
+1009
+1010
+
+
# File 'lib/graphql/schema.rb', line 1008
+
+def unauthorized_field(unauthorized_error)
+  unauthorized_object(unauthorized_error)
+end
+
+
+ +
+

+ + .unauthorized_object(unauthorized_error) ⇒ Object + + + + + +

+
+

This hook is called when an object fails an authorized? check. +You might report to your bug tracker here, so you can correct +the field resolvers not to return unauthorized objects.

+ +

By default, this hook just replaces the unauthorized object with nil.

+ +

Whatever value is returned from this method will be used instead of the +unauthorized object (accessible as unauthorized_error.object). If an +error is raised, then nil will be used.

+ +

If you want to add an error to the "errors" key, raise a ExecutionError +in this hook.

+ + +
+
+
+

Parameters:

+ + +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The returned object will be put in the GraphQL response

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+992
+993
+994
+
+
# File 'lib/graphql/schema.rb', line 992
+
+def unauthorized_object(unauthorized_error)
+  nil
+end
+
+
+ +
+

+ + .union_memberships(type = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+
+
# File 'lib/graphql/schema.rb', line 516
+
+def union_memberships(type = nil)
+  if type
+    own_um = own_union_memberships.fetch(type.graphql_name, EMPTY_ARRAY)
+    inherited_um = find_inherited_value(:union_memberships, EMPTY_HASH).fetch(type.graphql_name, EMPTY_ARRAY)
+    own_um + inherited_um
+  else
+    joined_um = own_union_memberships.dup
+    find_inherited_value(:union_memberhips, EMPTY_HASH).each do |k, v|
+      um = joined_um[k] ||= []
+      um.concat(v)
+    end
+    joined_um
+  end
+end
+
+
+ +
+

+ + .use(plugin, **kwargs) ⇒ Object + + + + + +

+ + + + +
+
+
+
+313
+314
+315
+316
+317
+318
+319
+320
+
+
# File 'lib/graphql/schema.rb', line 313
+
+def use(plugin, **kwargs)
+  if kwargs.any?
+    plugin.use(self, **kwargs)
+  else
+    plugin.use(self)
+  end
+  own_plugins << [plugin, kwargs]
+end
+
+
+ +
+

+ + .using_ast_analysis?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+721
+722
+723
+
+
# File 'lib/graphql/schema.rb', line 721
+
+def using_ast_analysis?
+  true
+end
+
+
+ +
+

+ + .validate(string_or_document, rules: nil, context: nil) ⇒ Array<GraphQL::StaticValidation::Error > + + + + + +

+
+

Validate a query string according to this schema.

+ + +
+
+
+

Parameters:

+ + +

Returns:

+ + +
+ + + + +
+
+
+
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+
+
# File 'lib/graphql/schema.rb', line 677
+
+def validate(string_or_document, rules: nil, context: nil)
+  doc = if string_or_document.is_a?(String)
+    GraphQL.parse(string_or_document)
+  else
+    string_or_document
+  end
+  query = GraphQL::Query.new(self, document: doc, context: context)
+  validator_opts = { schema: self }
+  rules && (validator_opts[:rules] = rules)
+  validator = GraphQL::StaticValidation::Validator.new(**validator_opts)
+  res = validator.validate(query, timeout: validate_timeout, max_errors: validate_max_errors)
+  res[:errors]
+end
+
+
+ +
+

+ + .visible?(member, ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+964
+965
+966
+
+
# File 'lib/graphql/schema.rb', line 964
+
+def visible?(member, ctx)
+  member.visible?(ctx)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Addition.html b/api-doc/2.1.6/GraphQL/Schema/Addition.html new file mode 100644 index 0000000000..2c2ce5a894 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Addition.html @@ -0,0 +1,647 @@ + + + + + + + Class: GraphQL::Schema::Addition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Addition + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/addition.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #arguments_with_default_values ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute arguments_with_default_values.

    +
    + +
  • + + +
  • + + + #directives ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute directives.

    +
    + +
  • + + +
  • + + + #possible_types ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute possible_types.

    +
    + +
  • + + +
  • + + + #references ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute references.

    +
    + +
  • + + +
  • + + + #types ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute types.

    +
    + +
  • + + +
  • + + + #union_memberships ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute union_memberships.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(schema:, own_types:, new_types:) ⇒ Addition + + + + + +

+
+

Returns a new instance of Addition.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/schema/addition.rb', line 8
+
+def initialize(schema:, own_types:, new_types:)
+  @schema = schema
+  @own_types = own_types
+  @directives = Set.new
+  @possible_types = {}
+  @types = {}
+  @union_memberships = {}
+  @references = Hash.new { |h, k| h[k] = [] }
+  @arguments_with_default_values = []
+  add_type_and_traverse(new_types)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #arguments_with_default_valuesObject (readonly) + + + + + +

+
+

Returns the value of attribute arguments_with_default_values.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/schema/addition.rb', line 6
+
+def arguments_with_default_values
+  @arguments_with_default_values
+end
+
+
+ + + +
+

+ + #directivesObject (readonly) + + + + + +

+
+

Returns the value of attribute directives.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/schema/addition.rb', line 6
+
+def directives
+  @directives
+end
+
+
+ + + +
+

+ + #possible_typesObject (readonly) + + + + + +

+
+

Returns the value of attribute possible_types.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/schema/addition.rb', line 6
+
+def possible_types
+  @possible_types
+end
+
+
+ + + +
+

+ + #referencesObject (readonly) + + + + + +

+
+

Returns the value of attribute references.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/schema/addition.rb', line 6
+
+def references
+  @references
+end
+
+
+ + + +
+

+ + #typesObject (readonly) + + + + + +

+
+

Returns the value of attribute types.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/schema/addition.rb', line 6
+
+def types
+  @types
+end
+
+
+ + + +
+

+ + #union_membershipsObject (readonly) + + + + + +

+
+

Returns the value of attribute union_memberships.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/schema/addition.rb', line 6
+
+def union_memberships
+  @union_memberships
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/AlwaysVisible.html b/api-doc/2.1.6/GraphQL/Schema/AlwaysVisible.html new file mode 100644 index 0000000000..3e32265366 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/AlwaysVisible.html @@ -0,0 +1,191 @@ + + + + + + + Class: GraphQL::Schema::AlwaysVisible + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::AlwaysVisible + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/always_visible.rb
+
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .use(schema, **opts) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/schema/always_visible.rb', line 5
+
+def self.use(schema, **opts)
+  schema.warden_class = GraphQL::Schema::Warden::NullWarden
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Argument.html b/api-doc/2.1.6/GraphQL/Schema/Argument.html new file mode 100644 index 0000000000..08c168c5ab --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Argument.html @@ -0,0 +1,2689 @@ + + + + + + + Class: GraphQL::Schema::Argument + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Argument + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
EmptyObjects, Member::HasAstNode, Member::HasDeprecationReason, Member::HasDirectives, Member::HasPath, Member::HasValidators
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/argument.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: InvalidDefaultValueError + + +

+ + + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description(text = nil) ⇒ String + + + + + + + + + + + + + + + + +

    Documentation for this argument.

    +
    + +
  • + + +
  • + + + #keyword ⇒ Symbol + + + + + + + + + readonly + + + + + + + + + +

    This argument’s name in Ruby keyword arguments.

    +
    + +
  • + + +
  • + + + #loads ⇒ Class, ... + + + + + + + + + readonly + + + + + + + + + +

    If this argument should load an application object, this is the type of object to load.

    +
    + +
  • + + +
  • + + + #name ⇒ String + + + + (also: #graphql_name) + + + + + + + readonly + + + + + + + + + +

    The GraphQL name for this argument, camelized unless camelize: false is provided.

    +
    + +
  • + + +
  • + + + #owner ⇒ GraphQL::Schema::Field, Class + + + + + + + + + readonly + + + + + + + + + +

    The field or input object this argument belongs to.

    +
    + +
  • + + +
+ + + + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + + + +

Methods included from Member::HasValidators

+

#validates, #validators

+ + + + + + + + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasPath

+

#path

+
+

Constructor Details

+ +
+

+ + #initialize(arg_name = nil, type_expr = nil, desc = nil, required: true, type: nil, name: nil, loads: nil, description: nil, ast_node: nil, default_value: NOT_CONFIGURED, as: nil, from_resolver: false, camelize: true, prepare: nil, owner:, validates: nil, directives: nil, deprecation_reason: nil, replace_null_with_default: false, &definition_block) ⇒ Argument + + + + + +

+
+

Returns a new instance of Argument.

+ + +
+
+
+

Parameters:

+
    + +
  • + + arg_name + + + (Symbol) + + + (defaults to: nil) + + +
  • + +
  • + + type_expr + + + + + + (defaults to: nil) + + +
  • + +
  • + + desc + + + (String) + + + (defaults to: nil) + + +
  • + +
  • + + required + + + (Boolean, :nullable) + + + (defaults to: true) + + + — +

    if true, this argument is non-null; if false, this argument is nullable. If :nullable, then the argument must be provided, though it may be null.

    +
    + +
  • + +
  • + + description + + + (String) + + + (defaults to: nil) + + +
  • + +
  • + + default_value + + + (Object) + + + (defaults to: NOT_CONFIGURED) + + +
  • + +
  • + + as + + + (Symbol) + + + (defaults to: nil) + + + — +

    Override the keyword name when passed to a method

    +
    + +
  • + +
  • + + prepare + + + (Symbol) + + + (defaults to: nil) + + + — +

    A method to call to transform this argument’s valuebefore sending it to field resolution

    +
    + +
  • + +
  • + + camelize + + + (Boolean) + + + (defaults to: true) + + + — +

    if true, the name will be camelized when building the schema

    +
    + +
  • + +
  • + + from_resolver + + + (Boolean) + + + (defaults to: false) + + + — +

    if true, a Resolver class defined this argument

    +
    + +
  • + +
  • + + directives + + + (Hash{Class => Hash}) + + + (defaults to: nil) + + +
  • + +
  • + + deprecation_reason + + + (String) + + + (defaults to: nil) + + +
  • + +
  • + + validates + + + (Hash, nil) + + + (defaults to: nil) + + + — +

    Options for building validators, if any should be applied

    +
    + +
  • + +
  • + + replace_null_with_default + + + (Boolean) + + + (defaults to: false) + + + — +

    if true, incoming values of null will be replaced with the configured default_value

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+
+
# File 'lib/graphql/schema/argument.rb', line 53
+
+def initialize(arg_name = nil, type_expr = nil, desc = nil, required: true, type: nil, name: nil, loads: nil, description: nil, ast_node: nil, default_value: NOT_CONFIGURED, as: nil, from_resolver: false, camelize: true, prepare: nil, owner:, validates: nil, directives: nil, deprecation_reason: nil, replace_null_with_default: false, &definition_block)
+  arg_name ||= name
+  @name = -(camelize ? Member::BuildType.camelize(arg_name.to_s) : arg_name.to_s)
+  @type_expr = type_expr || type
+  @description = desc || description
+  @null = required != true
+  @default_value = default_value
+  if replace_null_with_default
+    if !default_value?
+      raise ArgumentError, "`replace_null_with_default: true` requires a default value, please provide one with `default_value: ...`"
+    end
+    @replace_null_with_default = true
+  end
+
+  @owner = owner
+  @as = as
+  @loads = loads
+  @keyword = as || (arg_name.is_a?(Symbol) ? arg_name : Schema::Member::BuildType.underscore(@name).to_sym)
+  @prepare = prepare
+  @ast_node = ast_node
+  @from_resolver = from_resolver
+  self.deprecation_reason = deprecation_reason
+
+  if directives
+    directives.each do |dir_class, dir_options|
+      directive(dir_class, **dir_options)
+    end
+  end
+
+  if validates && !validates.empty?
+    self.validates(validates)
+  end
+
+  if required == :nullable
+    self.owner.validates(required: { argument: arg_name })
+  end
+
+  if definition_block
+    if definition_block.arity == 1
+      instance_exec(self, &definition_block)
+    else
+      instance_eval(&definition_block)
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #description(text = nil) ⇒ String + + + + + +

+
+

Returns Documentation for this argument.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    Documentation for this argument

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+124
+125
+126
+127
+128
+129
+130
+
+
# File 'lib/graphql/schema/argument.rb', line 124
+
+def description(text = nil)
+  if text
+    @description = text
+  else
+    @description
+  end
+end
+
+
+ + + +
+

+ + #keywordSymbol (readonly) + + + + + +

+
+

Returns This argument’s name in Ruby keyword arguments.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Symbol) + + + + — +

    This argument’s name in Ruby keyword arguments

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/graphql/schema/argument.rb', line 29
+
+def keyword
+  @keyword
+end
+
+
+ + + +
+

+ + #loadsClass, ... (readonly) + + + + + +

+
+

Returns If this argument should load an application object, this is the type of object to load.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class, Module, nil) + + + + — +

    If this argument should load an application object, this is the type of object to load

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/graphql/schema/argument.rb', line 32
+
+def loads
+  @loads
+end
+
+
+ + + +
+

+ + #nameString (readonly) + + + + Also known as: + graphql_name + + + + +

+
+

Returns the GraphQL name for this argument, camelized unless camelize: false is provided.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    the GraphQL name for this argument, camelized unless camelize: false is provided

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'lib/graphql/schema/argument.rb', line 13
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #ownerGraphQL::Schema::Field, Class (readonly) + + + + + +

+
+

Returns The field or input object this argument belongs to.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Schema::Field, Class) + + + + — +

    The field or input object this argument belongs to

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/schema/argument.rb', line 17
+
+def owner
+  @owner
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #authorized?(obj, value, ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+150
+151
+152
+
+
# File 'lib/graphql/schema/argument.rb', line 150
+
+def authorized?(obj, value, ctx)
+  authorized_as_type?(obj, value, ctx, as_type: type)
+end
+
+
+ +
+

+ + #authorized_as_type?(obj, value, ctx, as_type:) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+
+
# File 'lib/graphql/schema/argument.rb', line 154
+
+def authorized_as_type?(obj, value, ctx, as_type:)
+  if value.nil?
+    return true
+  end
+
+  if as_type.kind.non_null?
+    as_type = as_type.of_type
+  end
+
+  if as_type.kind.list?
+    value.each do |v|
+      if !authorized_as_type?(obj, v, ctx, as_type: as_type.of_type)
+        return false
+      end
+    end
+  elsif as_type.kind.input_object?
+    return as_type.authorized?(obj, value, ctx)
+  end
+  # None of the early-return conditions were activated,
+  # so this is authorized.
+  true
+end
+
+
+ +
+

+ + #coerce_into_values(parent_object, values, context, argument_values) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+
+
# File 'lib/graphql/schema/argument.rb', line 235
+
+def coerce_into_values(parent_object, values, context, argument_values)
+  arg_name = graphql_name
+  arg_key = keyword
+  default_used = false
+
+  if values.key?(arg_name)
+    value = values[arg_name]
+  elsif values.key?(arg_key)
+    value = values[arg_key]
+  elsif default_value?
+    value = default_value
+    default_used = true
+  else
+    # no value at all
+    owner.validate_directive_argument(self, nil)
+    return
+  end
+
+  if value.nil? && replace_null_with_default?
+    value = default_value
+    default_used = true
+  end
+
+  loaded_value = nil
+  coerced_value = begin
+    type.coerce_input(value, context)
+  rescue StandardError => err
+    context.schema.handle_or_reraise(context, err)
+  end
+
+  # If this isn't lazy, then the block returns eagerly and assigns the result here
+  # If it _is_ lazy, then we write the lazy to the hash, then update it later
+  argument_values[arg_key] = context.query.after_lazy(coerced_value) do |resolved_coerced_value|
+    owner.validate_directive_argument(self, resolved_coerced_value)
+    prepared_value = begin
+      prepare_value(parent_object, resolved_coerced_value, context: context)
+    rescue StandardError => err
+      context.schema.handle_or_reraise(context, err)
+    end
+
+    if loads && !from_resolver?
+      loaded_value = begin
+        load_and_authorize_value(owner, prepared_value, context)
+      rescue StandardError => err
+        context.schema.handle_or_reraise(context, err)
+      end
+    end
+
+    maybe_loaded_value = loaded_value || prepared_value
+    context.query.after_lazy(maybe_loaded_value) do |resolved_loaded_value|
+      # TODO code smell to access such a deeply-nested constant in a distant module
+      argument_values[arg_key] = GraphQL::Execution::Interpreter::ArgumentValue.new(
+        value: resolved_loaded_value,
+        definition: self,
+        default_used: default_used,
+      )
+    end
+  end
+end
+
+
+ +
+

+ + #default_value(new_default_value = NOT_CONFIGURED) ⇒ Object + + + + + +

+
+

Returns the value used when the client doesn’t provide a value for this argument.

+ + +
+
+
+

Parameters:

+
    + +
  • + + default_value + + + (Object) + + + + — +

    The value to use when the client doesn’t provide one

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the value used when the client doesn’t provide a value for this argument

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+105
+106
+107
+108
+109
+110
+
+
# File 'lib/graphql/schema/argument.rb', line 105
+
+def default_value(new_default_value = NOT_CONFIGURED)
+  if new_default_value != NOT_CONFIGURED
+    @default_value = new_default_value
+  end
+  @default_value
+end
+
+
+ +
+

+ + #default_value?Boolean + + + + + +

+
+

Returns True if this argument has a default value.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if this argument has a default value

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+113
+114
+115
+
+
# File 'lib/graphql/schema/argument.rb', line 113
+
+def default_value?
+  @default_value != NOT_CONFIGURED
+end
+
+
+ +
+

+ + #deprecation_reason(text = nil) ⇒ String + + + + + +

+
+

Returns Deprecation reason for this argument.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    Deprecation reason for this argument

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+133
+134
+135
+136
+137
+138
+139
+
+
# File 'lib/graphql/schema/argument.rb', line 133
+
+def deprecation_reason(text = nil)
+  if text
+    self.deprecation_reason = text
+  else
+    super()
+  end
+end
+
+
+ +
+

+ + #deprecation_reason=(new_reason) ⇒ Object + + + + + +

+ + + + +
+
+
+
+141
+142
+143
+144
+
+
# File 'lib/graphql/schema/argument.rb', line 141
+
+def deprecation_reason=(new_reason)
+  validate_deprecated_or_optional(null: @null, deprecation_reason: new_reason)
+  super
+end
+
+
+ +
+

+ + #from_resolver?Boolean + + + + + +

+
+

Returns true if a resolver defined this argument.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    true if a resolver defined this argument

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/graphql/schema/argument.rb', line 35
+
+def from_resolver?
+  @from_resolver
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+99
+100
+101
+
+
# File 'lib/graphql/schema/argument.rb', line 99
+
+def inspect
+  "#<#{self.class} #{path}: #{type.to_type_signature}#{description ? " @description=#{description.inspect}" : ""}>"
+end
+
+
+ +
+

+ + #load_and_authorize_value(load_method_owner, coerced_value, context) ⇒ Object + + + + + +

+ + + + +
+
+
+
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+
+
# File 'lib/graphql/schema/argument.rb', line 295
+
+def load_and_authorize_value(load_method_owner, coerced_value, context)
+  if coerced_value.nil?
+    return nil
+  end
+  arg_load_method = "load_#{keyword}"
+  if load_method_owner.respond_to?(arg_load_method)
+    custom_loaded_value = if load_method_owner.is_a?(Class)
+      load_method_owner.public_send(arg_load_method, coerced_value, context)
+    else
+      load_method_owner.public_send(arg_load_method, coerced_value)
+    end
+    context.query.after_lazy(custom_loaded_value) do |custom_value|
+      if loads
+        if type.list?
+          loaded_values = custom_value.each_with_index.map { |custom_val, idx|
+            id = coerced_value[idx]
+            load_method_owner.authorize_application_object(self, id, context, custom_val)
+          }
+          context.schema.after_any_lazies(loaded_values, &:itself)
+        else
+          load_method_owner.authorize_application_object(self, coerced_value, context, custom_loaded_value)
+        end
+      else
+        custom_value
+      end
+    end
+  elsif loads
+    if type.list?
+      loaded_values = coerced_value.map { |val| load_method_owner.load_and_authorize_application_object(self, val, context) }
+      context.schema.after_any_lazies(loaded_values, &:itself)
+    else
+      load_method_owner.load_and_authorize_application_object(self, coerced_value, context)
+    end
+  else
+    coerced_value
+  end
+end
+
+
+ +
+

+ + #prepare(new_prepare = NOT_CONFIGURED) ⇒ Symbol + + + + + +

+
+

Returns A method or proc to call to transform this value before sending it to field resolution method.

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_prepare + + + (Method, Proc) + + + (defaults to: NOT_CONFIGURED) + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Symbol) + + + + — +

    A method or proc to call to transform this value before sending it to field resolution method

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+
+
# File 'lib/graphql/schema/argument.rb', line 21
+
+def prepare(new_prepare = NOT_CONFIGURED)
+  if new_prepare != NOT_CONFIGURED
+    @prepare = new_prepare
+  end
+  @prepare
+end
+
+
+ +
+

+ + #prepare_value(obj, value, context: nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Apply the #prepare configuration to value, using methods from obj. +Used by the runtime.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+
+
# File 'lib/graphql/schema/argument.rb', line 208
+
+def prepare_value(obj, value, context: nil)
+  if value.is_a?(GraphQL::Schema::InputObject)
+    value = value.prepare
+  end
+
+  Schema::Validator.validate!(validators, obj, context, value)
+
+  if @prepare.nil?
+    value
+  elsif @prepare.is_a?(String) || @prepare.is_a?(Symbol)
+    if obj.nil?
+      # The problem here is, we _used to_ prepare while building variables.
+      # But now we don't have the runtime object there.
+      #
+      # This will have to be called later, when the runtime object _is_ available.
+      value
+    else
+      obj.public_send(@prepare, value)
+    end
+  elsif @prepare.respond_to?(:call)
+    @prepare.call(value, context || obj.context)
+  else
+    raise "Invalid prepare for #{@owner.name}.name: #{@prepare.inspect}"
+  end
+end
+
+
+ +
+

+ + #replace_null_with_default?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+117
+118
+119
+
+
# File 'lib/graphql/schema/argument.rb', line 117
+
+def replace_null_with_default?
+  @replace_null_with_default
+end
+
+
+ +
+

+ + #statically_coercible?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+199
+200
+201
+202
+203
+
+
# File 'lib/graphql/schema/argument.rb', line 199
+
+def statically_coercible?
+  return @statically_coercible if defined?(@statically_coercible)
+  requires_parent_object = @prepare.is_a?(String) || @prepare.is_a?(Symbol) || @own_validators
+  @statically_coercible = !requires_parent_object
+end
+
+
+ +
+

+ + #typeObject + + + + + +

+ + + + +
+
+
+
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+
+
# File 'lib/graphql/schema/argument.rb', line 187
+
+def type
+  @type ||= begin
+    parsed_type = begin
+      Member::BuildType.parse_type(@type_expr, null: @null)
+    rescue StandardError => err
+      raise ArgumentError, "Couldn't build type for Argument #{@owner.name}.#{name}: #{err.class.name}: #{err.message}", err.backtrace
+    end
+    # Use the setter method to get validations
+    self.type = parsed_type
+  end
+end
+
+
+ +
+

+ + #type=(new_type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+177
+178
+179
+180
+181
+182
+183
+184
+185
+
+
# File 'lib/graphql/schema/argument.rb', line 177
+
+def type=(new_type)
+  validate_input_type(new_type)
+  # This isn't true for LateBoundTypes, but we can assume those will
+  # be updated via this codepath later in schema setup.
+  if new_type.respond_to?(:non_null?)
+    validate_deprecated_or_optional(null: !new_type.non_null?, deprecation_reason: deprecation_reason)
+  end
+  @type = new_type
+end
+
+
+ +
+

+ + #validate_default_valueObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+
+
# File 'lib/graphql/schema/argument.rb', line 334
+
+def validate_default_value
+  coerced_default_value = begin
+    # This is weird, but we should accept single-item default values for list-type arguments.
+    # If we used `coerce_isolated_input` below, it would do this for us, but it's not really
+    # the right thing here because we expect default values in application format (Ruby values)
+    # not GraphQL format (scalar values).
+    #
+    # But I don't think Schema::List#coerce_result should apply wrapping to single-item lists.
+    prepped_default_value = if default_value.nil?
+      nil
+    elsif (type.kind.list? || (type.kind.non_null? && type.of_type.list?)) && !default_value.respond_to?(:map)
+      [default_value]
+    else
+      default_value
+    end
+
+    type.coerce_isolated_result(prepped_default_value) unless prepped_default_value.nil?
+  rescue GraphQL::Schema::Enum::UnresolvedValueError
+    # It raises this, which is helpful at runtime, but not here...
+    default_value
+  end
+  res = type.valid_isolated_input?(coerced_default_value)
+  if !res
+    raise InvalidDefaultValueError.new(self)
+  end
+end
+
+
+ +
+

+ + #visible?(context) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+146
+147
+148
+
+
# File 'lib/graphql/schema/argument.rb', line 146
+
+def visible?(context)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Argument/InvalidDefaultValueError.html b/api-doc/2.1.6/GraphQL/Schema/Argument/InvalidDefaultValueError.html new file mode 100644 index 0000000000..cd7d6727a2 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Argument/InvalidDefaultValueError.html @@ -0,0 +1,214 @@ + + + + + + + Exception: GraphQL::Schema::Argument::InvalidDefaultValueError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::Argument::InvalidDefaultValueError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/argument.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(argument) ⇒ InvalidDefaultValueError + + + + + +

+
+

Returns a new instance of InvalidDefaultValueError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+362
+363
+364
+365
+
+
# File 'lib/graphql/schema/argument.rb', line 362
+
+def initialize(argument)
+  message = "`#{argument.path}` has an invalid default value: `#{argument.default_value.inspect}` isn't accepted by `#{argument.type.to_type_signature}`; update the default value or the argument type."
+  super(message)
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Base64Encoder.html b/api-doc/2.1.6/GraphQL/Schema/Base64Encoder.html new file mode 100644 index 0000000000..d6bdccc2cb --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Base64Encoder.html @@ -0,0 +1,276 @@ + + + + + + + Module: GraphQL::Schema::Base64Encoder + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Base64Encoder + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/base_64_encoder.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .decode(encoded_text, nonce: false) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/schema/base_64_encoder.rb', line 13
+
+def self.decode(encoded_text, nonce: false)
+  # urlsafe_decode64 is for forward compatibility
+  Base64Bp.urlsafe_decode64(encoded_text)
+rescue ArgumentError
+  raise GraphQL::ExecutionError, "Invalid input: #{encoded_text.inspect}"
+end
+
+
+ +
+

+ + .encode(unencoded_text, nonce: false) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/schema/base_64_encoder.rb', line 9
+
+def self.encode(unencoded_text, nonce: false)
+  Base64Bp.urlsafe_encode64(unencoded_text, padding: false)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition.html b/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition.html new file mode 100644 index 0000000000..17789b40e8 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition.html @@ -0,0 +1,310 @@ + + + + + + + Module: GraphQL::Schema::BuildFromDefinition + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::BuildFromDefinition + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/build_from_definition.rb,
+ lib/graphql/schema/build_from_definition/resolve_map.rb,
lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: ResolveMap + + +

+ + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .from_definition(schema_superclass, definition_string, parser: GraphQL.default_parser, **kwargs) ⇒ Object + + + + + +

+
+ + + +
+
+
+ + +

See Also:

+
    + +
  • {Schema{Schema.from_definition}
  • + +
+ +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/schema/build_from_definition.rb', line 9
+
+def from_definition(schema_superclass, definition_string, parser: GraphQL.default_parser, **kwargs)
+  from_document(schema_superclass, parser.parse(definition_string), **kwargs)
+end
+
+
+ +
+

+ + .from_definition_path(schema_superclass, definition_path, parser: GraphQL.default_parser, **kwargs) ⇒ Object + + + + + +

+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'lib/graphql/schema/build_from_definition.rb', line 13
+
+def from_definition_path(schema_superclass, definition_path, parser: GraphQL.default_parser, **kwargs)
+  from_document(schema_superclass, parser.parse_file(definition_path), **kwargs)
+end
+
+
+ +
+

+ + .from_document(schema_superclass, document, default_resolve:, using: {}, relay: false) ⇒ Object + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/schema/build_from_definition.rb', line 17
+
+def from_document(schema_superclass, document, default_resolve:, using: {}, relay: false)
+  Builder.build(schema_superclass, document, default_resolve: default_resolve || {}, relay: relay, using: using)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap.html b/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap.html new file mode 100644 index 0000000000..d7c1eb7665 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap.html @@ -0,0 +1,520 @@ + + + + + + + Class: GraphQL::Schema::BuildFromDefinition::ResolveMap + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::BuildFromDefinition::ResolveMap + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/build_from_definition/resolve_map.rb,
+ lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb
+
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

Wrap a user-provided hash of resolution behavior for easy access at runtime.

+ +

Coerce scalar values by: +- Checking for a function in the map like { Date: { coerce_input: ->(val, ctx) { ... }, coerce_result: ->(val, ctx) { ... } } } +- Falling back to a passthrough

+ +

Interface/union resolution can be provided as a resolve_type: key.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: NullScalarCoerce + + + + Classes: DefaultResolve + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(user_resolve_hash) ⇒ ResolveMap + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of ResolveMap.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+
+
# File 'lib/graphql/schema/build_from_definition/resolve_map.rb', line 23
+
+def initialize(user_resolve_hash)
+  @resolve_hash = Hash.new do |h, k|
+    # For each type name, provide a new hash if one wasn't given:
+    h[k] = Hash.new do |h2, k2|
+      if k2 == "coerce_input" || k2 == "coerce_result"
+        # This isn't an object field, it's a scalar coerce function.
+        # Use a passthrough
+        NullScalarCoerce
+      else
+        # For each field, provide a resolver that will
+        # make runtime checks & replace itself
+        h2[k2] = DefaultResolve.new(h2, k2)
+      end
+    end
+  end
+  @user_resolve_hash = user_resolve_hash
+  # User-provided resolve functions take priority over the default:
+  @user_resolve_hash.each do |type_name, fields|
+    type_name_s = type_name.to_s
+    case fields
+    when Hash
+      fields.each do |field_name, resolve_fn|
+        @resolve_hash[type_name_s][field_name.to_s] = resolve_fn
+      end
+    when Proc
+      # for example, "resolve_type"
+      @resolve_hash[type_name_s] = fields
+    else
+      raise ArgumentError, "Unexpected resolve hash value for #{type_name.inspect}: #{fields.inspect} (#{fields.class})"
+    end
+  end
+
+  # Check the normalized hash, not the user input:
+  if @resolve_hash.key?("resolve_type")
+    define_singleton_method :resolve_type do |type, obj, ctx|
+      @resolve_hash.fetch("resolve_type").call(type, obj, ctx)
+    end
+  end
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #call(type, field, obj, args, ctx) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+63
+64
+65
+66
+
+
# File 'lib/graphql/schema/build_from_definition/resolve_map.rb', line 63
+
+def call(type, field, obj, args, ctx)
+  resolver = @resolve_hash[type.graphql_name][field.graphql_name]
+  resolver.call(obj, args, ctx)
+end
+
+
+ +
+

+ + #coerce_input(type, value, ctx) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+68
+69
+70
+
+
# File 'lib/graphql/schema/build_from_definition/resolve_map.rb', line 68
+
+def coerce_input(type, value, ctx)
+  @resolve_hash[type.graphql_name]["coerce_input"].call(value, ctx)
+end
+
+
+ +
+

+ + #coerce_result(type, value, ctx) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+72
+73
+74
+
+
# File 'lib/graphql/schema/build_from_definition/resolve_map.rb', line 72
+
+def coerce_result(type, value, ctx)
+  @resolve_hash[type.graphql_name]["coerce_result"].call(value, ctx)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap/DefaultResolve.html b/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap/DefaultResolve.html new file mode 100644 index 0000000000..33912b8012 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap/DefaultResolve.html @@ -0,0 +1,341 @@ + + + + + + + Class: GraphQL::Schema::BuildFromDefinition::ResolveMap::DefaultResolve + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::BuildFromDefinition::ResolveMap::DefaultResolve + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb
+
+ +
+ +
+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(field_map, field_name) ⇒ DefaultResolve + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of DefaultResolve.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb', line 7
+
+def initialize(field_map, field_name)
+  @field_map = field_map
+  @field_name = field_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #call(obj, args, ctx) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Make some runtime checks about +how obj implements the field_name.

+ +

Create a new resolve function according to that implementation, then: + - update field_map with this implementation + - call the implementation now (to satisfy this field execution)

+ +

If obj doesn’t implement field_name, raise an error.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb', line 20
+
+def call(obj, args, ctx)
+  method_name = @field_name
+  if !obj.respond_to?(method_name)
+    raise KeyError, "Can't resolve field #{method_name} on #{obj.inspect}"
+  else
+    method_arity = obj.method(method_name).arity
+    resolver = case method_arity
+    when 0, -1
+      # -1 Handles method_missing, eg openstruct
+      ->(o, a, c) { o.public_send(method_name) }
+    when 1
+      ->(o, a, c) { o.public_send(method_name, a) }
+    when 2
+      ->(o, a, c) { o.public_send(method_name, a, c) }
+    else
+      raise "Unexpected resolve arity: #{method_arity}. Must be 0, 1, 2"
+    end
+    # Call the resolver directly next time
+    @field_map[method_name] = resolver
+    # Call through this time
+    resolver.call(obj, args, ctx)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap/NullScalarCoerce.html b/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap/NullScalarCoerce.html new file mode 100644 index 0000000000..7ad4645c49 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/BuildFromDefinition/ResolveMap/NullScalarCoerce.html @@ -0,0 +1,203 @@ + + + + + + + Module: GraphQL::Schema::BuildFromDefinition::ResolveMap::NullScalarCoerce + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::BuildFromDefinition::ResolveMap::NullScalarCoerce + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/build_from_definition/resolve_map.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .call(val, _ctx) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/graphql/schema/build_from_definition/resolve_map.rb', line 18
+
+def self.call(val, _ctx)
+  val
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive.html b/api-doc/2.1.6/GraphQL/Schema/Directive.html new file mode 100644 index 0000000000..067150c60b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive.html @@ -0,0 +1,1691 @@ + + + + + + + Class: GraphQL::Schema::Directive + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Directive + + + +

+
+ +
+
Inherits:
+
+ Member + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Member::HasArguments, Member::HasArguments::HasDirectiveArguments
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive.rb,
+ lib/graphql/schema/directive/skip.rb,
lib/graphql/schema/directive/one_of.rb,
lib/graphql/schema/directive/feature.rb,
lib/graphql/schema/directive/flagged.rb,
lib/graphql/schema/directive/include.rb,
lib/graphql/schema/directive/transform.rb,
lib/graphql/schema/directive/deprecated.rb,
lib/graphql/schema/directive/specified_by.rb
+
+
+ +
+ +

Overview

+
+

Subclasses of this can influence how Execution::Interpreter runs queries.

+ +
    +
  • Directive.include?: if it returns false, the field or fragment will be skipped altogether, as if it were absent
  • +
  • Directive.resolve: Wraps field resolution (so it should call yield to continue)
  • +
+ + +
+
+
+ + +
+

Direct Known Subclasses

+

Deprecated, Feature, Flagged, Include, OneOf, Skip, SpecifiedBy, Transform

+
+

Defined Under Namespace

+

+ + + + + Classes: Deprecated, Feature, Flagged, Include, OneOf, Skip, SpecifiedBy, Transform + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
LOCATIONS = + +
+
[
+  QUERY =                  :QUERY,
+  MUTATION =               :MUTATION,
+  SUBSCRIPTION =           :SUBSCRIPTION,
+  FIELD =                  :FIELD,
+  FRAGMENT_DEFINITION =    :FRAGMENT_DEFINITION,
+  FRAGMENT_SPREAD =        :FRAGMENT_SPREAD,
+  INLINE_FRAGMENT =        :INLINE_FRAGMENT,
+  SCHEMA =                 :SCHEMA,
+  SCALAR =                 :SCALAR,
+  OBJECT =                 :OBJECT,
+  FIELD_DEFINITION =       :FIELD_DEFINITION,
+  ARGUMENT_DEFINITION =    :ARGUMENT_DEFINITION,
+  INTERFACE =              :INTERFACE,
+  UNION =                  :UNION,
+  ENUM =                   :ENUM,
+  ENUM_VALUE =             :ENUM_VALUE,
+  INPUT_OBJECT =           :INPUT_OBJECT,
+  INPUT_FIELD_DEFINITION = :INPUT_FIELD_DEFINITION,
+  VARIABLE_DEFINITION =    :VARIABLE_DEFINITION,
+]
+ +
DEFAULT_DEPRECATION_REASON = + +
+
'No longer supported'
+ +
LOCATION_DESCRIPTIONS = + +
+
{
+  QUERY:                    'Location adjacent to a query operation.',
+  MUTATION:                 'Location adjacent to a mutation operation.',
+  SUBSCRIPTION:             'Location adjacent to a subscription operation.',
+  FIELD:                    'Location adjacent to a field.',
+  FRAGMENT_DEFINITION:      'Location adjacent to a fragment definition.',
+  FRAGMENT_SPREAD:          'Location adjacent to a fragment spread.',
+  INLINE_FRAGMENT:          'Location adjacent to an inline fragment.',
+  SCHEMA:                   'Location adjacent to a schema definition.',
+  SCALAR:                   'Location adjacent to a scalar definition.',
+  OBJECT:                   'Location adjacent to an object type definition.',
+  FIELD_DEFINITION:         'Location adjacent to a field definition.',
+  ARGUMENT_DEFINITION:      'Location adjacent to an argument definition.',
+  INTERFACE:                'Location adjacent to an interface definition.',
+  UNION:                    'Location adjacent to a union definition.',
+  ENUM:                     'Location adjacent to an enum definition.',
+  ENUM_VALUE:               'Location adjacent to an enum value definition.',
+  INPUT_OBJECT:             'Location adjacent to an input object type definition.',
+  INPUT_FIELD_DEFINITION:   'Location adjacent to an input object field definition.',
+  VARIABLE_DEFINITION:      'Location adjacent to a variable definition.',
+}
+ +
+ + + + + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Member::HasArguments

+

add_argument, all_argument_definitions, any_arguments?, argument, argument_class, arguments_statically_coercible?, coerce_arguments, get_argument, own_arguments, remove_argument, validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasArguments::HasDirectiveArguments

+

validate_directive_argument

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(owner, **arguments) ⇒ Directive + + + + + +

+
+

Returns a new instance of Directive.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+
+
# File 'lib/graphql/schema/directive.rb', line 114
+
+def initialize(owner, **arguments)
+  @owner = owner
+  assert_valid_owner
+  # It's be nice if we had the real context here, but we don't. What we _would_ get is:
+  # - error handling
+  # - lazy resolution
+  # Probably, those won't be needed here, since these are configuration arguments,
+  # not runtime arguments.
+  @arguments = self.class.coerce_arguments(nil, arguments, Query::NullContext.instance)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argumentsGraphQL::Interpreter::Arguments (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Interpreter::Arguments) + + + +
  • + +
+ +
+ + + + +
+
+
+
+112
+113
+114
+
+
# File 'lib/graphql/schema/directive.rb', line 112
+
+def arguments
+  @arguments
+end
+
+
+ + + +
+

+ + #ownerGraphQL::Schema::Field, ... (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+109
+110
+111
+
+
# File 'lib/graphql/schema/directive.rb', line 109
+
+def owner
+  @owner
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .default_directive(new_default_directive = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
+
# File 'lib/graphql/schema/directive.rb', line 44
+
+def default_directive(new_default_directive = nil)
+  if new_default_directive != nil
+    @default_directive = new_default_directive
+  elsif @default_directive.nil?
+    @default_directive = (superclass.respond_to?(:default_directive) ? superclass.default_directive : false)
+  else
+    !!@default_directive
+  end
+end
+
+
+ +
+

+ + .default_directive?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+54
+55
+56
+
+
# File 'lib/graphql/schema/directive.rb', line 54
+
+def default_directive?
+  default_directive
+end
+
+
+ +
+

+ + .default_graphql_nameObject + + + + + +

+
+

Return a name based on the class name, +but downcase the first letter.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+
+
# File 'lib/graphql/schema/directive.rb', line 23
+
+def default_graphql_name
+  @default_graphql_name ||= begin
+    camelized_name = super.dup
+    camelized_name[0] = camelized_name[0].downcase
+    -camelized_name
+  end
+end
+
+
+ +
+

+ + .include?(_object, arguments, context) ⇒ Boolean + + + + + +

+
+

If false, this part of the query won’t be evaluated

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+59
+60
+61
+
+
# File 'lib/graphql/schema/directive.rb', line 59
+
+def include?(_object, arguments, context)
+  static_include?(arguments, context)
+end
+
+
+ +
+

+ + .locations(*new_locations) ⇒ Object + + + + + +

+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'lib/graphql/schema/directive.rb', line 31
+
+def locations(*new_locations)
+  if new_locations.any?
+    new_locations.each do |new_loc|
+      if !LOCATIONS.include?(new_loc.to_sym)
+        raise ArgumentError, "#{self} (#{self.graphql_name}) has an invalid directive location: `locations #{new_loc}` "
+      end
+    end
+    @locations = new_locations
+  else
+    @locations ||= (superclass.respond_to?(:locations) ? superclass.locations : [])
+  end
+end
+
+
+ +
+

+ + .on_field?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+78
+79
+80
+
+
# File 'lib/graphql/schema/directive.rb', line 78
+
+def on_field?
+  locations.include?(FIELD)
+end
+
+
+ +
+

+ + .on_fragment?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+82
+83
+84
+
+
# File 'lib/graphql/schema/directive.rb', line 82
+
+def on_fragment?
+  locations.include?(FRAGMENT_SPREAD) && locations.include?(INLINE_FRAGMENT)
+end
+
+
+ +
+

+ + .on_operation?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+86
+87
+88
+
+
# File 'lib/graphql/schema/directive.rb', line 86
+
+def on_operation?
+  locations.include?(QUERY) && locations.include?(MUTATION) && locations.include?(SUBSCRIPTION)
+end
+
+
+ +
+

+ + .pathObject + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/schema/directive.rb', line 17
+
+def path
+  "@#{super}"
+end
+
+
+ +
+

+ + .repeatable(new_value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'lib/graphql/schema/directive.rb', line 94
+
+def repeatable(new_value)
+  @repeatable = new_value
+end
+
+
+ +
+

+ + .repeatable?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+90
+91
+92
+
+
# File 'lib/graphql/schema/directive.rb', line 90
+
+def repeatable?
+  !!@repeatable
+end
+
+
+ +
+

+ + .resolve(object, arguments, context) ⇒ Object + + + + + +

+
+

Continuing is passed as a block; yield to continue

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/graphql/schema/directive.rb', line 69
+
+def resolve(object, arguments, context)
+  yield
+end
+
+
+ +
+

+ + .resolve_each(object, arguments, context) ⇒ Object + + + + + +

+
+

Continuing is passed as a block, yield to continue.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+74
+75
+76
+
+
# File 'lib/graphql/schema/directive.rb', line 74
+
+def resolve_each(object, arguments, context)
+  yield
+end
+
+
+ +
+

+ + .static_include?(_arguments, _context) ⇒ Boolean + + + + + +

+
+

Determines whether Execution::Lookahead considers the field to be selected

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+64
+65
+66
+
+
# File 'lib/graphql/schema/directive.rb', line 64
+
+def static_include?(_arguments, _context)
+  true
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #graphql_nameObject + + + + + +

+ + + + +
+
+
+
+125
+126
+127
+
+
# File 'lib/graphql/schema/directive.rb', line 125
+
+def graphql_name
+  self.class.graphql_name
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive/Deprecated.html b/api-doc/2.1.6/GraphQL/Schema/Directive/Deprecated.html new file mode 100644 index 0000000000..d2df276177 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive/Deprecated.html @@ -0,0 +1,303 @@ + + + + + + + Class: GraphQL::Schema::Directive::Deprecated + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Directive::Deprecated + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Directive + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive/deprecated.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from GraphQL::Schema::Directive

+

DEFAULT_DEPRECATION_REASON, LOCATIONS, LOCATION_DESCRIPTIONS

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Directive

+

#arguments, #owner

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from GraphQL::Schema::Directive

+

default_directive, default_directive?, default_graphql_name, #graphql_name, include?, #initialize, locations, on_field?, on_fragment?, on_operation?, path, repeatable, repeatable?, resolve, resolve_each, static_include?

+ + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasArguments::HasDirectiveArguments

+

#validate_directive_argument

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Directive

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive/Feature.html b/api-doc/2.1.6/GraphQL/Schema/Directive/Feature.html new file mode 100644 index 0000000000..328a590856 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive/Feature.html @@ -0,0 +1,587 @@ + + + + + + + Class: GraphQL::Schema::Directive::Feature + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Directive::Feature + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Directive + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive/feature.rb
+
+ +
+ +

Overview

+
+

An example directive to show how you might interact with the runtime.

+ +

This directive might be used along with a server-side feature flag system like Flipper.

+ +

With that system, you could use this directive to exclude parts of a query +if the current viewer doesn’t have certain flags enabled. +(So, this flag would be for internal clients, like your iOS app, not third-party API clients.)

+ +

To use it, you have to implement .enabled?, for example:

+ + +
+
+
+ +
+

Examples:

+ + +

Implementing the Feature directive

+

+ +
# app/graphql/directives/feature.rb
+class Directives::Feature < GraphQL::Schema::Directive::Feature
+  def self.enabled?(flag_name, _obj, context)
+    # Translate some GraphQL data for Ruby:
+    flag_key = flag_name.underscore
+    current_user = context[:viewer]
+    # Check the feature flag however your app does it:
+    MyFeatureFlags.enabled?(current_user, flag_key)
+  end
+end
+ + +

Flagging a part of the query

+

+ +
viewer {
+  # This field only runs if `.enabled?("recommendationEngine", obj, context)`
+  # returns true. Otherwise, it's treated as if it didn't exist.
+  recommendations @feature(flag: "recommendationEngine") {
+    name
+    rating
+  }
+}
+ +
+ + +
+ + +

Constant Summary

+ +

Constants inherited + from GraphQL::Schema::Directive

+

DEFAULT_DEPRECATION_REASON, LOCATIONS, LOCATION_DESCRIPTIONS

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Directive

+

#arguments, #owner

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Directive

+

default_directive, default_directive?, default_graphql_name, #graphql_name, #initialize, locations, on_field?, on_fragment?, on_operation?, path, repeatable, repeatable?, resolve, resolve_each, static_include?

+ + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasArguments::HasDirectiveArguments

+

#validate_directive_argument

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Directive

+ +
+ + +
+

Class Method Details

+ + +
+

+ + .enabled?(flag_name, object, context) ⇒ Boolean + + + + + +

+
+

Override this method in your app’s subclass of this directive.

+ + +
+
+
+

Parameters:

+
    + +
  • + + flag_name + + + (String) + + + + — +

    The client-provided string of a feature to check

    +
    + +
  • + +
  • + + object + + + (GraphQL::Schema::Objct) + + + + — +

    The currently-evaluated GraphQL object instance

    +
    + +
  • + +
  • + + context + + + (GraphQL::Query::Context) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    If truthy, execution will continue

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+60
+61
+62
+
+
# File 'lib/graphql/schema/directive/feature.rb', line 60
+
+def self.enabled?(flag_name, object, context)
+  raise GraphQL::RequiredImplementationMissingError, "Implement `.enabled?(flag_name, object, context)` to return true or false for the feature flag (#{flag_name.inspect})"
+end
+
+
+ +
+

+ + .include?(object, arguments, context) ⇒ Boolean + + + + + +

+
+

Implement the Directive API

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+49
+50
+51
+52
+
+
# File 'lib/graphql/schema/directive/feature.rb', line 49
+
+def self.include?(object, arguments, context)
+  flag_name = arguments[:flag]
+  self.enabled?(flag_name, object, context)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive/Flagged.html b/api-doc/2.1.6/GraphQL/Schema/Directive/Flagged.html new file mode 100644 index 0000000000..d6520aa380 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive/Flagged.html @@ -0,0 +1,419 @@ + + + + + + + Class: GraphQL::Schema::Directive::Flagged + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Directive::Flagged + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Directive + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive/flagged.rb
+
+ +
+ +

Overview

+
+

This is similar to Feature, except it’s prescribed by the server, not the client.

+ +

In this case, the server hides types and fields entirely, unless the current context has certain :flags present.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: VisibleByFlag + + + + +

+ + + +

Constant Summary

+ +

Constants inherited + from GraphQL::Schema::Directive

+

DEFAULT_DEPRECATION_REASON, LOCATIONS, LOCATION_DESCRIPTIONS

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Directive

+

#arguments, #owner

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Directive

+

default_directive, default_directive?, default_graphql_name, #graphql_name, include?, locations, on_field?, on_fragment?, on_operation?, path, repeatable, repeatable?, resolve, resolve_each, static_include?

+ + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasArguments::HasDirectiveArguments

+

#validate_directive_argument

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(target, **options) ⇒ Flagged + + + + + +

+
+

Returns a new instance of Flagged.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/schema/directive/flagged.rb', line 9
+
+def initialize(target, **options)
+  if target.is_a?(Module) && !target.ancestors.include?(VisibleByFlag)
+    # This is type class of some kind, `include` will put this module
+    # in between the type class itself and its super class, so `super` will work fine
+    target.include(VisibleByFlag)
+  elsif !target.is_a?(VisibleByFlag)
+    # This is an instance of a base class. `include` won't put this in front of the
+    # base class implementation, so we need to `.prepend`.
+    # `#visible?` could probably be moved to a module and then this could use `include` instead.
+    target.class.prepend(VisibleByFlag)
+  end
+  super
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive/Flagged/VisibleByFlag.html b/api-doc/2.1.6/GraphQL/Schema/Directive/Flagged/VisibleByFlag.html new file mode 100644 index 0000000000..d1cea31444 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive/Flagged/VisibleByFlag.html @@ -0,0 +1,208 @@ + + + + + + + Module: GraphQL::Schema::Directive::Flagged::VisibleByFlag + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Directive::Flagged::VisibleByFlag + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive/flagged.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #visible?(context) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+45
+46
+47
+48
+49
+50
+51
+52
+
+
# File 'lib/graphql/schema/directive/flagged.rb', line 45
+
+def visible?(context)
+  if dir = self.directives.find { |d| d.is_a?(Flagged) }
+    relevant_flags = (f = context[:flags]) && dir.arguments[:by] & f # rubocop:disable Development/ContextIsPassedCop -- definition-related
+    relevant_flags && relevant_flags.any? && super
+  else
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive/Include.html b/api-doc/2.1.6/GraphQL/Schema/Directive/Include.html new file mode 100644 index 0000000000..3f0e6e99b5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive/Include.html @@ -0,0 +1,396 @@ + + + + + + + Class: GraphQL::Schema::Directive::Include + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Directive::Include + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Directive + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive/include.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from GraphQL::Schema::Directive

+

DEFAULT_DEPRECATION_REASON, LOCATIONS, LOCATION_DESCRIPTIONS

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Directive

+

#arguments, #owner

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Directive

+

default_directive, default_directive?, default_graphql_name, #graphql_name, include?, #initialize, locations, on_field?, on_fragment?, on_operation?, path, repeatable, repeatable?, resolve, resolve_each

+ + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasArguments::HasDirectiveArguments

+

#validate_directive_argument

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Directive

+ +
+ + +
+

Class Method Details

+ + +
+

+ + .static_include?(args, ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/schema/directive/include.rb', line 19
+
+def self.static_include?(args, ctx)
+  !!args[:if]
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive/OneOf.html b/api-doc/2.1.6/GraphQL/Schema/Directive/OneOf.html new file mode 100644 index 0000000000..823ee9d5ef --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive/OneOf.html @@ -0,0 +1,391 @@ + + + + + + + Class: GraphQL::Schema::Directive::OneOf + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Directive::OneOf + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Directive + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive/one_of.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: IsOneOf + + + + +

+ + + +

Constant Summary

+ +

Constants inherited + from GraphQL::Schema::Directive

+

DEFAULT_DEPRECATION_REASON, LOCATIONS, LOCATION_DESCRIPTIONS

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Directive

+

#arguments, #owner

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Instance Method Summary + collapse +

+ +
    + +
  • + + + #initialize ⇒ OneOf + + + + + + + constructor + + + + + + + + +

    A new instance of OneOf.

    +
    + +
  • + + +
+ + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Directive

+

default_directive, default_directive?, default_graphql_name, #graphql_name, include?, locations, on_field?, on_fragment?, on_operation?, path, repeatable, repeatable?, resolve, resolve_each, static_include?

+ + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasArguments::HasDirectiveArguments

+

#validate_directive_argument

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initializeOneOf + + + + + +

+
+

Returns a new instance of OneOf.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/schema/directive/one_of.rb', line 10
+
+def initialize(...)
+  super
+
+  owner.extend(IsOneOf)
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive/OneOf/IsOneOf.html b/api-doc/2.1.6/GraphQL/Schema/Directive/OneOf/IsOneOf.html new file mode 100644 index 0000000000..49c71ce90f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive/OneOf/IsOneOf.html @@ -0,0 +1,198 @@ + + + + + + + Module: GraphQL::Schema::Directive::OneOf::IsOneOf + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Directive::OneOf::IsOneOf + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive/one_of.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #one_of?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/schema/directive/one_of.rb', line 17
+
+def one_of?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive/Skip.html b/api-doc/2.1.6/GraphQL/Schema/Directive/Skip.html new file mode 100644 index 0000000000..536f69e6a0 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive/Skip.html @@ -0,0 +1,396 @@ + + + + + + + Class: GraphQL::Schema::Directive::Skip + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Directive::Skip + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Directive + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive/skip.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from GraphQL::Schema::Directive

+

DEFAULT_DEPRECATION_REASON, LOCATIONS, LOCATION_DESCRIPTIONS

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Directive

+

#arguments, #owner

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Directive

+

default_directive, default_directive?, default_graphql_name, #graphql_name, include?, #initialize, locations, on_field?, on_fragment?, on_operation?, path, repeatable, repeatable?, resolve, resolve_each

+ + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasArguments::HasDirectiveArguments

+

#validate_directive_argument

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Directive

+ +
+ + +
+

Class Method Details

+ + +
+

+ + .static_include?(args, ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/schema/directive/skip.rb', line 19
+
+def self.static_include?(args, ctx)
+  !args[:if]
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive/SpecifiedBy.html b/api-doc/2.1.6/GraphQL/Schema/Directive/SpecifiedBy.html new file mode 100644 index 0000000000..4b2a77ee0d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive/SpecifiedBy.html @@ -0,0 +1,303 @@ + + + + + + + Class: GraphQL::Schema::Directive::SpecifiedBy + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Directive::SpecifiedBy + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Directive + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive/specified_by.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from GraphQL::Schema::Directive

+

DEFAULT_DEPRECATION_REASON, LOCATIONS, LOCATION_DESCRIPTIONS

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Directive

+

#arguments, #owner

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + + + + + + + +

Method Summary

+ +

Methods inherited from GraphQL::Schema::Directive

+

default_directive, default_directive?, default_graphql_name, #graphql_name, include?, #initialize, locations, on_field?, on_fragment?, on_operation?, path, repeatable, repeatable?, resolve, resolve_each, static_include?

+ + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasArguments::HasDirectiveArguments

+

#validate_directive_argument

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Directive

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Directive/Transform.html b/api-doc/2.1.6/GraphQL/Schema/Directive/Transform.html new file mode 100644 index 0000000000..b94ff6f6a8 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Directive/Transform.html @@ -0,0 +1,474 @@ + + + + + + + Class: GraphQL::Schema::Directive::Transform + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Directive::Transform + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Directive + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/directive/transform.rb
+
+ +
+ +

Overview

+
+

An example directive to show how you might interact with the runtime.

+ +

This directive takes the return value of the tagged part of the query, +and if the named transform is whitelisted and applies to the return value, +it’s applied by calling a method with that name.

+ + +
+
+
+ +
+

Examples:

+ + +

Installing the directive

+

+ +
class MySchema < GraphQL::Schema
+  directive(GraphQL::Schema::Directive::Transform)
+end
+ + +

Transforming strings

+

+ +
viewer {
+  username @transform(by: "upcase")
+}
+ +
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
TRANSFORMS = + +
+
[
+  "upcase",
+  "downcase",
+  # ??
+]
+ +
+ + + + + + +

Constants inherited + from GraphQL::Schema::Directive

+

DEFAULT_DEPRECATION_REASON, LOCATIONS, LOCATION_DESCRIPTIONS

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Directive

+

#arguments, #owner

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Directive

+

default_directive, default_directive?, default_graphql_name, #graphql_name, include?, #initialize, locations, on_field?, on_fragment?, on_operation?, path, repeatable, repeatable?, resolve_each, static_include?

+ + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasArguments::HasDirectiveArguments

+

#validate_directive_argument

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Directive

+ +
+ + +
+

Class Method Details

+ + +
+

+ + .resolve(object, arguments, context) ⇒ Object + + + + + +

+
+

Implement the Directive API

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+
+
# File 'lib/graphql/schema/directive/transform.rb', line 36
+
+def self.resolve(object, arguments, context)
+  path = context.namespace(:interpreter)[:current_path]
+  return_value = yield
+  transform_name = arguments[:by]
+  if TRANSFORMS.include?(transform_name) && return_value.respond_to?(transform_name)
+    return_value = return_value.public_send(transform_name)
+    response = context.namespace(:interpreter_runtime)[:runtime].final_result
+    *keys, last = path
+    keys.each do |key|
+      if response && (response = response[key])
+        next
+      else
+        break
+      end
+    end
+    if response
+      response[last] = return_value
+    end
+    nil
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/DuplicateNamesError.html b/api-doc/2.1.6/GraphQL/Schema/DuplicateNamesError.html new file mode 100644 index 0000000000..fdaa4d60f1 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/DuplicateNamesError.html @@ -0,0 +1,298 @@ + + + + + + + Exception: GraphQL::Schema::DuplicateNamesError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::DuplicateNamesError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #duplicated_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute duplicated_name.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(duplicated_name:, duplicated_definition_1:, duplicated_definition_2:) ⇒ DuplicateNamesError + + + + + +

+
+

Returns a new instance of DuplicateNamesError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+83
+84
+85
+86
+87
+88
+
+
# File 'lib/graphql/schema.rb', line 83
+
+def initialize(duplicated_name:, duplicated_definition_1:, duplicated_definition_2:)
+  @duplicated_name = duplicated_name
+  super(
+    "Found two visible definitions for `#{duplicated_name}`: #{duplicated_definition_1}, #{duplicated_definition_2}"
+  )
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #duplicated_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute duplicated_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+82
+83
+84
+
+
# File 'lib/graphql/schema.rb', line 82
+
+def duplicated_name
+  @duplicated_name
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Enum.html b/api-doc/2.1.6/GraphQL/Schema/Enum.html new file mode 100644 index 0000000000..590dc037ea --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Enum.html @@ -0,0 +1,1141 @@ + + + + + + + Class: GraphQL::Schema::Enum + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Enum + + + +

+
+ +
+
Inherits:
+
+ Member + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Member::ValidatesInput
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/schema/enum.rb
+
+ +
+ +

Overview

+
+

Extend this class to define GraphQL enums in your schema.

+ +

By default, GraphQL enum values are translated into Ruby strings. +You can provide a custom value with the value: keyword.

+ + +
+
+
+ +
+

Examples:

+ + +
# equivalent to
+# enum PizzaTopping {
+#   MUSHROOMS
+#   ONIONS
+#   PEPPERS
+# }
+class PizzaTopping < GraphQL::Enum
+  value :MUSHROOMS
+  value :ONIONS
+  value :PEPPERS
+end
+ +
+ + +
+

Defined Under Namespace

+

+ + + + + Classes: MissingValuesError, UnresolvedValueError + + +

+ + + +

Constant Summary

+ +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Member::ValidatesInput

+

coerce_isolated_input, coerce_isolated_result, valid_input?, valid_isolated_input?, validate_input

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .all_enum_value_definitionsArray<Schema::EnumValue> + + + + + +

+
+

Returns An unfiltered list of all definitions.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Schema::EnumValue>) + + + + — +

    An unfiltered list of all definitions

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+
+
# File 'lib/graphql/schema/enum.rb', line 94
+
+def all_enum_value_definitions
+  all_defns = if superclass.respond_to?(:all_enum_value_definitions)
+    superclass.all_enum_value_definitions
+  else
+    []
+  end
+
+  @own_values && @own_values.each do |_key, value|
+    if value.is_a?(Array)
+      all_defns.concat(value)
+    else
+      all_defns << value
+    end
+  end
+
+  all_defns
+end
+
+
+ +
+

+ + .coerce_input(value_name, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+
+
# File 'lib/graphql/schema/enum.rb', line 154
+
+def coerce_input(value_name, ctx)
+  all_values = ctx.warden ? ctx.warden.enum_values(self) : values.each_value
+
+  if v = all_values.find { |val| val.graphql_name == value_name }
+    v.value
+  elsif v = all_values.find { |val| val.value == value_name }
+    # this is for matching default values, which are "inputs", but they're
+    # the Ruby value, not the GraphQL string.
+    v.value
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + .coerce_result(value, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+
+
# File 'lib/graphql/schema/enum.rb', line 143
+
+def coerce_result(value, ctx)
+  warden = ctx.warden
+  all_values = warden ? warden.enum_values(self) : values.each_value
+  enum_value = all_values.find { |val| val.value == value }
+  if enum_value
+    enum_value.graphql_name
+  else
+    raise self::UnresolvedValueError.new(enum: self, value: value, context: ctx)
+  end
+end
+
+
+ +
+

+ + .enum_value_class(new_enum_value_class = nil) ⇒ Class + + + + + +

+
+

Returns for handling value(...) inputs and building GraphQL::Enum::EnumValues out of them.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    for handling value(...) inputs and building GraphQL::Enum::EnumValues out of them

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+118
+119
+120
+121
+122
+123
+124
+125
+126
+
+
# File 'lib/graphql/schema/enum.rb', line 118
+
+def enum_value_class(new_enum_value_class = nil)
+  if new_enum_value_class
+    @enum_value_class = new_enum_value_class
+  elsif defined?(@enum_value_class) && @enum_value_class
+    @enum_value_class
+  else
+    superclass <= GraphQL::Schema::Enum ? superclass.enum_value_class : nil
+  end
+end
+
+
+ +
+

+ + .enum_values(context = GraphQL::Query::NullContext.instance) ⇒ Array<GraphQL::Schema::EnumValue> + + + + + +

+
+

Returns Possible values of this enum.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+
+
# File 'lib/graphql/schema/enum.rb', line 71
+
+def enum_values(context = GraphQL::Query::NullContext.instance)
+  inherited_values = superclass.respond_to?(:enum_values) ? superclass.enum_values(context) : nil
+  visible_values = []
+  warden = Warden.from_context(context)
+  own_values.each do |key, values_entry|
+    if (v = Warden.visible_entry?(:visible_enum_value?, values_entry, context, warden))
+      visible_values << v
+    end
+  end
+
+  if inherited_values
+    # Local values take precedence over inherited ones
+    inherited_values.each do |i_val|
+      if !visible_values.any? { |v| v.graphql_name == i_val.graphql_name }
+        visible_values << i_val
+      end
+    end
+  end
+
+  visible_values
+end
+
+
+ +
+

+ + .kindObject + + + + + +

+ + + + +
+
+
+
+128
+129
+130
+
+
# File 'lib/graphql/schema/enum.rb', line 128
+
+def kind
+  GraphQL::TypeKinds::ENUM
+end
+
+
+ +
+

+ + .validate_non_null_input(value_name, ctx, max_errors: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+
+
# File 'lib/graphql/schema/enum.rb', line 132
+
+def validate_non_null_input(value_name, ctx, max_errors: nil)
+  allowed_values = ctx.warden.enum_values(self)
+  matching_value = allowed_values.find { |v| v.graphql_name == value_name }
+
+  if matching_value.nil?
+    GraphQL::Query::InputValidationResult.from_problem("Expected #{GraphQL::Language.serialize(value_name)} to be one of: #{allowed_values.map(&:graphql_name).join(', ')}")
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + .value(*args, **kwargs, &block) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Define a value for this enum

+ + +
+
+
+

Parameters:

+
    + +
  • + + graphql_name + + + (String, Symbol) + + + + — +

    the GraphQL value for this, usually SCREAMING_CASE

    +
    + +
  • + +
  • + + description + + + (String) + + + + — +

    , the GraphQL description for this value, present in documentation

    +
    + +
  • + +
  • + + value + + + (Object) + + + + — +

    , the translated Ruby value for this object (defaults to graphql_name)

    +
    + +
  • + +
  • + + deprecation_reason + + + (String) + + + + — +

    if this object is deprecated, include a message here

    +
    + +
  • + +
+ + +

See Also:

+
    + +
  • which handles these inputs by default
  • + +
+ +
+ + + + +
+
+
+
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'lib/graphql/schema/enum.rb', line 52
+
+def value(*args, **kwargs, &block)
+  kwargs[:owner] = self
+  value = enum_value_class.new(*args, **kwargs, &block)
+  key = value.graphql_name
+  prev_value = own_values[key]
+  case prev_value
+  when nil
+    own_values[key] = value
+  when GraphQL::Schema::EnumValue
+    own_values[key] = [prev_value, value]
+  when Array
+    prev_value << value
+  else
+    raise "Invariant: Unexpected enum value for #{key.inspect}: #{prev_value.inspect}"
+  end
+  value
+end
+
+
+ +
+

+ + .values(context = GraphQL::Query::NullContext.instance) ⇒ Hash<String => GraphQL::Schema::EnumValue> + + + + + +

+
+

Returns Possible values of this enum, keyed by name.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+113
+114
+115
+
+
# File 'lib/graphql/schema/enum.rb', line 113
+
+def values(context = GraphQL::Query::NullContext.instance)
+  enum_values(context).each_with_object({}) { |val, obj| obj[val.graphql_name] = val }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Enum/MissingValuesError.html b/api-doc/2.1.6/GraphQL/Schema/Enum/MissingValuesError.html new file mode 100644 index 0000000000..ca8f432a95 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Enum/MissingValuesError.html @@ -0,0 +1,214 @@ + + + + + + + Exception: GraphQL::Schema::Enum::MissingValuesError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::Enum::MissingValuesError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/enum.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(enum_type) ⇒ MissingValuesError + + + + + +

+
+

Returns a new instance of MissingValuesError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+38
+39
+40
+41
+
+
# File 'lib/graphql/schema/enum.rb', line 38
+
+def initialize(enum_type)
+  @enum_type = enum_type
+  super("Enum types require at least one value, but #{enum_type.graphql_name} didn't provide any for this query. Make sure at least one value is defined and visible for this query.")
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Enum/UnresolvedValueError.html b/api-doc/2.1.6/GraphQL/Schema/Enum/UnresolvedValueError.html new file mode 100644 index 0000000000..293124dc98 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Enum/UnresolvedValueError.html @@ -0,0 +1,224 @@ + + + + + + + Exception: GraphQL::Schema::Enum::UnresolvedValueError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::Enum::UnresolvedValueError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/enum.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(value:, enum:, context:) ⇒ UnresolvedValueError + + + + + +

+
+

Returns a new instance of UnresolvedValueError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'lib/graphql/schema/enum.rb', line 26
+
+def initialize(value:, enum:, context:)
+  fix_message = ", but this isn't a valid value for `#{enum.graphql_name}`. Update the field or resolver to return one of `#{enum.graphql_name}`'s values instead."
+  message = if (cp = context[:current_path]) && (cf = context[:current_field])
+    "`#{cf.path}` returned `#{value.inspect}` at `#{cp.join(".")}`#{fix_message}"
+  else
+    "`#{value.inspect}` was returned for `#{enum.graphql_name}`#{fix_message}"
+  end
+  super(message)
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/EnumValue.html b/api-doc/2.1.6/GraphQL/Schema/EnumValue.html new file mode 100644 index 0000000000..fffa748abc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/EnumValue.html @@ -0,0 +1,897 @@ + + + + + + + Class: GraphQL::Schema::EnumValue + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::EnumValue + + + +

+
+ +
+
Inherits:
+
+ Member + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Member::HasAstNode, Member::HasDeprecationReason, Member::HasDirectives, Member::HasPath
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/enum_value.rb
+
+ +
+ +

Overview

+
+

A possible value for an Enum.

+ +

You can extend this class to customize enum values in your schema.

+ + +
+
+
+ +
+

Examples:

+ + +

custom enum value class

+

+ +
# define a custom class:
+class CustomEnumValue < GraphQL::Schema::EnumValue
+  def initialize(*args)
+    # arguments to `value(...)` in Enum classes are passed here
+    super
+  end
+end
+
+class BaseEnum < GraphQL::Schema::Enum
+  # use it for these enums:
+  enum_value_class CustomEnumValue
+end
+ +
+ + +
+ + +

Constant Summary

+ +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #graphql_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute graphql_name.

    +
    + +
  • + + +
  • + + + #owner ⇒ Class + + + + + + + + + readonly + + + + + + + + + +

    The enum type that owns this value.

    +
    + +
  • + + +
+ + + + + +

Attributes included from Member::HasDeprecationReason

+

#deprecation_reason

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#default_relay, #introspection, #introspection?, #mutation, #name

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(graphql_name, desc = nil, owner:, ast_node: nil, directives: nil, description: nil, value: NOT_CONFIGURED, deprecation_reason: nil, &block) ⇒ EnumValue + + + + + +

+
+

Returns a new instance of EnumValue.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
+
# File 'lib/graphql/schema/enum_value.rb', line 33
+
+def initialize(graphql_name, desc = nil, owner:, ast_node: nil, directives: nil, description: nil, value: NOT_CONFIGURED, deprecation_reason: nil, &block)
+  @graphql_name = graphql_name.to_s
+  GraphQL::NameValidator.validate!(@graphql_name)
+  @description = desc || description
+  @value = value == NOT_CONFIGURED ? @graphql_name : value
+  if deprecation_reason
+    self.deprecation_reason = deprecation_reason
+  end
+  @owner = owner
+  @ast_node = ast_node
+  if directives
+    directives.each do |dir_class, dir_options|
+      directive(dir_class, **dir_options)
+    end
+  end
+
+  if block_given?
+    instance_eval(&block)
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #graphql_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute graphql_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/schema/enum_value.rb', line 28
+
+def graphql_name
+  @graphql_name
+end
+
+
+ + + +
+

+ + #ownerClass (readonly) + + + + + +

+
+

Returns The enum type that owns this value.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    The enum type that owns this value

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'lib/graphql/schema/enum_value.rb', line 31
+
+def owner
+  @owner
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #authorized?(_ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+73
+
+
# File 'lib/graphql/schema/enum_value.rb', line 73
+
+def authorized?(_ctx); true; end
+
+
+ +
+

+ + #description(new_desc = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+
+
# File 'lib/graphql/schema/enum_value.rb', line 54
+
+def description(new_desc = nil)
+  if new_desc
+    @description = new_desc
+  end
+  @description
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+68
+69
+70
+
+
# File 'lib/graphql/schema/enum_value.rb', line 68
+
+def inspect
+  "#<#{self.class} #{path} @value=#{@value.inspect}#{description ? " @description=#{description.inspect}" : ""}>"
+end
+
+
+ +
+

+ + #value(new_val = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+61
+62
+63
+64
+65
+66
+
+
# File 'lib/graphql/schema/enum_value.rb', line 61
+
+def value(new_val = nil)
+  unless new_val.nil?
+    @value = new_val
+  end
+  @value
+end
+
+
+ +
+

+ + #visible?(_ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+72
+
+
# File 'lib/graphql/schema/enum_value.rb', line 72
+
+def visible?(_ctx); true; end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Field.html b/api-doc/2.1.6/GraphQL/Schema/Field.html new file mode 100644 index 0000000000..226e3ec51d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Field.html @@ -0,0 +1,5053 @@ + + + + + + + Class: GraphQL::Schema::Field + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Field + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
FindInheritedValue
+
+ + + +
+
Includes:
+
EmptyObjects, Member::HasArguments, Member::HasArguments::FieldConfigured, Member::HasAstNode, Member::HasDeprecationReason, Member::HasDirectives, Member::HasPath, Member::HasValidators
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/field.rb,
+ lib/graphql/schema/field/scope_extension.rb,
lib/graphql/schema/field/connection_extension.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: ConnectionExtension, ExtendedState, FieldImplementationFailed, MissingReturnTypeError, ScopeExtension + + +

+ + + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description(text = nil) ⇒ String + + + + + + + + + + + + + + + + +
    +
    + +
  • + + +
  • + + + #dig_keys ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute dig_keys.

    +
    + +
  • + + +
  • + + + #dynamic_introspection ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute dynamic_introspection.

    +
    + +
  • + + +
  • + + + #hash_key ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute hash_key.

    +
    + +
  • + + +
  • + + + #method_str ⇒ String + + + + + + + + + readonly + + + + + + + + + +

    Method or hash key on the underlying object to look up.

    +
    + +
  • + + +
  • + + + #method_sym ⇒ Symbol + + + + + + + + + readonly + + + + + + + + + +

    Method or hash key on the underlying object to look up.

    +
    + +
  • + + +
  • + + + #name ⇒ String + + + + (also: #graphql_name) + + + + + + + readonly + + + + + + + + + +

    The GraphQL name for this field, camelized unless camelize: false is provided.

    +
    + +
  • + + +
  • + + + #original_name ⇒ Symbol + + + + + + + + + readonly + + + + + + + + + +

    The original name of the field, passed in by the user.

    +
    + +
  • + + +
  • + + + #owner ⇒ Class + + + + + + + + + + + + + + + + +

    The thing this field was defined on (type, mutation, resolver).

    +
    + +
  • + + +
  • + + + #relay_node_field ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Boolean.

    +
    + +
  • + + +
  • + + + #relay_nodes_field ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Boolean.

    +
    + +
  • + + +
  • + + + #subscription_scope ⇒ String? + + + + + + + + + + + + + + + + +
    +
    + +
  • + + +
  • + + + #trace ⇒ Boolean + + + + + + + + + readonly + + + + + + + + + +

    Apply tracing to this field? (Default: skip scalars, this is the override value).

    +
    + +
  • + + +
  • + + + #type ⇒ Object + + + + + + + + + + + + + + + + +
    +
    + +
  • + + +
+ + + + + +

Attributes included from Member::HasDeprecationReason

+

#deprecation_reason

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + + + + + + + + +

Methods included from Member::HasValidators

+

#validates, #validators

+ + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasArguments::FieldConfigured

+

#all_argument_definitions, #any_arguments?, #arguments

+ + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+
+

Constructor Details

+ +
+

+ + #initialize(type: nil, name: nil, owner: nil, null: nil, description: NOT_CONFIGURED, deprecation_reason: nil, method: nil, hash_key: nil, dig: nil, resolver_method: nil, connection: nil, max_page_size: NOT_CONFIGURED, default_page_size: NOT_CONFIGURED, scope: nil, introspection: false, camelize: true, trace: nil, complexity: nil, ast_node: nil, extras: EMPTY_ARRAY, extensions: EMPTY_ARRAY, connection_extension: self.class.connection_extension, resolver_class: nil, subscription_scope: nil, relay_node_field: false, relay_nodes_field: false, method_conflict_warning: true, broadcastable: NOT_CONFIGURED, arguments: EMPTY_HASH, directives: EMPTY_HASH, validates: EMPTY_ARRAY, fallback_value: NOT_CONFIGURED, dynamic_introspection: false, &definition_block) ⇒ Field + + + + + +

+
+

Returns a new instance of Field.

+ + +
+
+
+

Parameters:

+
    + +
  • + + name + + + (Symbol) + + + (defaults to: nil) + + + — +

    The underscore-cased version of this field name (will be camelized for the GraphQL API)

    +
    + +
  • + +
  • + + type + + + (Class, GraphQL::BaseType, Array) + + + (defaults to: nil) + + + — +

    The return type of this field

    +
    + +
  • + +
  • + + owner + + + (Class) + + + (defaults to: nil) + + + — +

    The type that this field belongs to

    +
    + +
  • + +
  • + + null + + + (Boolean) + + + (defaults to: nil) + + + — +

    (defaults to true) true if this field may return null, false if it is never null

    +
    + +
  • + +
  • + + description + + + (String) + + + (defaults to: NOT_CONFIGURED) + + + — +

    Field description

    +
    + +
  • + +
  • + + deprecation_reason + + + (String) + + + (defaults to: nil) + + + — +

    If present, the field is marked “deprecated” with this message

    +
    + +
  • + +
  • + + method + + + (Symbol) + + + (defaults to: nil) + + + — +

    The method to call on the underlying object to resolve this field (defaults to name)

    +
    + +
  • + +
  • + + hash_key + + + (String, Symbol) + + + (defaults to: nil) + + + — +

    The hash key to lookup on the underlying object (if its a Hash) to resolve this field (defaults to name or name.to_s)

    +
    + +
  • + +
  • + + dig + + + (Array<String, Symbol>) + + + (defaults to: nil) + + + — +

    The nested hash keys to lookup on the underlying hash to resolve this field using dig

    +
    + +
  • + +
  • + + resolver_method + + + (Symbol) + + + (defaults to: nil) + + + — +

    The method on the type to call to resolve this field (defaults to name)

    +
    + +
  • + +
  • + + connection + + + (Boolean) + + + (defaults to: nil) + + + — +

    true if this field should get automagic connection behavior; default is to infer by *Connection in the return type name

    +
    + +
  • + +
  • + + connection_extension + + + (Class) + + + (defaults to: self.class.connection_extension) + + + — +

    The extension to add, to implement connections. If nil, no extension is added.

    +
    + +
  • + +
  • + + max_page_size + + + (Integer, nil) + + + (defaults to: NOT_CONFIGURED) + + + — +

    For connections, the maximum number of items to return from this field, or nil to allow unlimited results.

    +
    + +
  • + +
  • + + default_page_size + + + (Integer, nil) + + + (defaults to: NOT_CONFIGURED) + + + — +

    For connections, the default number of items to return from this field, or nil to return unlimited results.

    +
    + +
  • + +
  • + + introspection + + + (Boolean) + + + (defaults to: false) + + + — +

    If true, this field will be marked as #introspection? and the name may begin with __

    +
    + +
  • + +
  • + + resolver_class + + + (Class) + + + (defaults to: nil) + + + — +

    (Private) A Resolver which this field was derived from. Use resolver: to create a field with a resolver.

    +
    + +
  • + +
  • + + arguments + + + ({String=>GraphQL::Schema::Argument, Hash}) + + + (defaults to: EMPTY_HASH) + + + — +

    Arguments for this field (may be added in the block, also)

    +
    + +
  • + +
  • + + camelize + + + (Boolean) + + + (defaults to: true) + + + — +

    If true, the field name will be camelized when building the schema

    +
    + +
  • + +
  • + + complexity + + + (Numeric) + + + (defaults to: nil) + + + — +

    When provided, set the complexity for this field

    +
    + +
  • + +
  • + + scope + + + (Boolean) + + + (defaults to: nil) + + + — +

    If true, the return type’s .scope_items method will be called on the return value

    +
    + +
  • + +
  • + + subscription_scope + + + (Symbol, String) + + + (defaults to: nil) + + + — +

    A key in context which will be used to scope subscription payloads

    +
    + +
  • + +
  • + + extensions + + + (Array<Class, Hash<Class => Object>>) + + + (defaults to: EMPTY_ARRAY) + + + — +

    Named extensions to apply to this field (see also #extension)

    +
    + +
  • + +
  • + + directives + + + (Hash{Class => Hash}) + + + (defaults to: EMPTY_HASH) + + + — +

    Directives to apply to this field

    +
    + +
  • + +
  • + + trace + + + (Boolean) + + + (defaults to: nil) + + + — +

    If true, a Tracing tracer will measure this scalar field

    +
    + +
  • + +
  • + + broadcastable + + + (Boolean) + + + (defaults to: NOT_CONFIGURED) + + + — +

    Whether or not this field can be distributed in subscription broadcasts

    +
    + +
  • + +
  • + + ast_node + + + (Language::Nodes::FieldDefinition, nil) + + + (defaults to: nil) + + + — +

    If this schema was parsed from definition, this AST node defined the field

    +
    + +
  • + +
  • + + method_conflict_warning + + + (Boolean) + + + (defaults to: true) + + + — +

    If false, skip the warning if this field’s method conflicts with a built-in method

    +
    + +
  • + +
  • + + validates + + + (Array<Hash>) + + + (defaults to: EMPTY_ARRAY) + + + — +

    Configurations for validating this field

    +
    + +
  • + +
  • + + fallback_value + + + (Object) + + + (defaults to: NOT_CONFIGURED) + + + — +

    A fallback value if the method is not defined

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+
+
# File 'lib/graphql/schema/field.rb', line 222
+
+def initialize(type: nil, name: nil, owner: nil, null: nil, description: NOT_CONFIGURED, deprecation_reason: nil, method: nil, hash_key: nil, dig: nil, resolver_method: nil, connection: nil, max_page_size: NOT_CONFIGURED, default_page_size: NOT_CONFIGURED, scope: nil, introspection: false, camelize: true, trace: nil, complexity: nil, ast_node: nil, extras: EMPTY_ARRAY, extensions: EMPTY_ARRAY, connection_extension: self.class.connection_extension, resolver_class: nil, subscription_scope: nil, relay_node_field: false, relay_nodes_field: false, method_conflict_warning: true, broadcastable: NOT_CONFIGURED, arguments: EMPTY_HASH, directives: EMPTY_HASH, validates: EMPTY_ARRAY, fallback_value: NOT_CONFIGURED, dynamic_introspection: false, &definition_block)
+  if name.nil?
+    raise ArgumentError, "missing first `name` argument or keyword `name:`"
+  end
+  if !(resolver_class)
+    if type.nil?
+      raise ArgumentError, "missing second `type` argument or keyword `type:`"
+    end
+  end
+  @original_name = name
+  name_s = -name.to_s
+
+  @underscored_name = -Member::BuildType.underscore(name_s)
+  @name = -(camelize ? Member::BuildType.camelize(name_s) : name_s)
+
+  @description = description
+  @type = @owner_type = @own_validators = @own_directives = @own_arguments = @arguments_statically_coercible = nil # these will be prepared later if necessary
+
+  self.deprecation_reason = deprecation_reason
+
+  if method && hash_key && dig
+    raise ArgumentError, "Provide `method:`, `hash_key:` _or_ `dig:`, not multiple. (called with: `method: #{method.inspect}, hash_key: #{hash_key.inspect}, dig: #{dig.inspect}`)"
+  end
+
+  if resolver_method
+    if method
+      raise ArgumentError, "Provide `method:` _or_ `resolver_method:`, not both. (called with: `method: #{method.inspect}, resolver_method: #{resolver_method.inspect}`)"
+    end
+
+    if hash_key || dig
+      raise ArgumentError, "Provide `hash_key:`, `dig:`, _or_ `resolver_method:`, not multiple. (called with: `hash_key: #{hash_key.inspect}, dig: #{dig.inspect}, resolver_method: #{resolver_method.inspect}`)"
+    end
+  end
+
+  method_name = method || hash_key || name_s
+  @dig_keys = dig
+  if hash_key
+    @hash_key = hash_key
+    @hash_key_str = hash_key.to_s
+  else
+    @hash_key = NOT_CONFIGURED
+    @hash_key_str = NOT_CONFIGURED
+  end
+
+  @method_str = -method_name.to_s
+  @method_sym = method_name.to_sym
+  @resolver_method = (resolver_method || name_s).to_sym
+  @complexity = complexity
+  @dynamic_introspection = dynamic_introspection
+  @return_type_expr = type
+  @return_type_null = if !null.nil?
+    null
+  elsif resolver_class
+    nil
+  else
+    true
+  end
+  @connection = connection
+  @max_page_size = max_page_size
+  @default_page_size = default_page_size
+  @introspection = introspection
+  @extras = extras
+  @broadcastable = broadcastable
+  @resolver_class = resolver_class
+  @scope = scope
+  @trace = trace
+  @relay_node_field = relay_node_field
+  @relay_nodes_field = relay_nodes_field
+  @ast_node = ast_node
+  @method_conflict_warning = method_conflict_warning
+  @fallback_value = fallback_value
+
+  arguments.each do |name, arg|
+    case arg
+    when Hash
+      argument(name: name, **arg)
+    when GraphQL::Schema::Argument
+      add_argument(arg)
+    when Array
+      arg.each { |a| add_argument(a) }
+    else
+      raise ArgumentError, "Unexpected argument config (#{arg.class}): #{arg.inspect}"
+    end
+  end
+
+  @owner = owner
+  @subscription_scope = subscription_scope
+
+  @extensions = EMPTY_ARRAY
+  @call_after_define = false
+  # This should run before connection extension,
+  # but should it run after the definition block?
+  if scoped?
+    self.extension(ScopeExtension)
+  end
+
+  # The problem with putting this after the definition_block
+  # is that it would override arguments
+  if connection? && connection_extension
+    self.extension(connection_extension)
+  end
+
+  # Do this last so we have as much context as possible when initializing them:
+  if extensions.any?
+    self.extensions(extensions)
+  end
+
+  if resolver_class && resolver_class.extensions.any?
+    self.extensions(resolver_class.extensions)
+  end
+
+  if directives.any?
+    directives.each do |(dir_class, options)|
+      self.directive(dir_class, **options)
+    end
+  end
+
+  if !validates.empty?
+    self.validates(validates)
+  end
+
+  if block_given?
+    if definition_block.arity == 1
+      yield self
+    else
+      instance_eval(&definition_block)
+    end
+  end
+
+  self.extensions.each(&:after_define_apply)
+  @call_after_define = true
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #description(text = nil) ⇒ String + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + text + + + (String) + + + (defaults to: nil) + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+
+
# File 'lib/graphql/schema/field.rb', line 372
+
+def description(text = nil)
+  if text
+    @description = text
+  elsif !NOT_CONFIGURED.equal?(@description)
+    @description
+  elsif @resolver_class
+    @resolver_class.description
+  else
+    nil
+  end
+end
+
+
+ + + +
+

+ + #dig_keysObject (readonly) + + + + + +

+
+

Returns the value of attribute dig_keys.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/schema/field.rb', line 33
+
+def dig_keys
+  @dig_keys
+end
+
+
+ + + +
+

+ + #dynamic_introspectionObject + + + + + +

+
+

Returns the value of attribute dynamic_introspection.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+355
+356
+357
+
+
# File 'lib/graphql/schema/field.rb', line 355
+
+def dynamic_introspection
+  @dynamic_introspection
+end
+
+
+ + + +
+

+ + #hash_keyObject (readonly) + + + + + +

+
+

Returns the value of attribute hash_key.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/graphql/schema/field.rb', line 32
+
+def hash_key
+  @hash_key
+end
+
+
+ + + +
+

+ + #method_strString (readonly) + + + + + +

+
+

Returns Method or hash key on the underlying object to look up.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    Method or hash key on the underlying object to look up

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/schema/field.rb', line 30
+
+def method_str
+  @method_str
+end
+
+
+ + + +
+

+ + #method_symSymbol (readonly) + + + + + +

+
+

Returns Method or hash key on the underlying object to look up.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Symbol) + + + + — +

    Method or hash key on the underlying object to look up

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/graphql/schema/field.rb', line 27
+
+def method_sym
+  @method_sym
+end
+
+
+ + + +
+

+ + #nameString (readonly) + + + + Also known as: + graphql_name + + + + +

+
+

Returns the GraphQL name for this field, camelized unless camelize: false is provided.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    the GraphQL name for this field, camelized unless camelize: false is provided

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'lib/graphql/schema/field.rb', line 21
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #original_nameSymbol (readonly) + + + + + +

+
+

Returns the original name of the field, passed in by the user.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Symbol) + + + + — +

    the original name of the field, passed in by the user

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+59
+60
+61
+
+
# File 'lib/graphql/schema/field.rb', line 59
+
+def original_name
+  @original_name
+end
+
+
+ + + +
+

+ + #ownerClass + + + + + +

+
+

Returns The thing this field was defined on (type, mutation, resolver).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    The thing this field was defined on (type, mutation, resolver)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+45
+46
+47
+
+
# File 'lib/graphql/schema/field.rb', line 45
+
+def owner
+  @owner
+end
+
+
+ + + +
+

+ + #relay_node_fieldObject (readonly) + + + + + +

+
+

Returns Boolean.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +

    Boolean

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+184
+185
+186
+
+
# File 'lib/graphql/schema/field.rb', line 184
+
+def relay_node_field
+  @relay_node_field
+end
+
+
+ + + +
+

+ + #relay_nodes_fieldObject (readonly) + + + + + +

+
+

Returns Boolean.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +

    Boolean

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+186
+187
+188
+
+
# File 'lib/graphql/schema/field.rb', line 186
+
+def relay_nodes_field
+  @relay_nodes_field
+end
+
+
+ + + +
+

+ + #subscription_scopeString? + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+81
+82
+83
+
+
# File 'lib/graphql/schema/field.rb', line 81
+
+def subscription_scope
+  @subscription_scope || (@resolver_class.respond_to?(:subscription_scope) ? @resolver_class.subscription_scope : nil)
+end
+
+
+ + + +
+

+ + #traceBoolean (readonly) + + + + + +

+
+

Returns Apply tracing to this field? (Default: skip scalars, this is the override value).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Apply tracing to this field? (Default: skip scalars, this is the override value)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+78
+79
+80
+
+
# File 'lib/graphql/schema/field.rb', line 78
+
+def trace
+  @trace
+end
+
+
+ + + +
+

+ + #typeObject + + + + + +

+ + + + +
+
+
+
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+
+
# File 'lib/graphql/schema/field.rb', line 583
+
+def type
+  if @resolver_class
+    return_type = @return_type_expr || @resolver_class.type_expr
+    if return_type.nil?
+      raise MissingReturnTypeError, "Can't determine the return type for #{self.path} (it has `resolver: #{@resolver_class}`, perhaps that class is missing a `type ...` declaration, or perhaps its type causes a cyclical loading issue)"
+    end
+    nullable = @return_type_null.nil? ? @resolver_class.null : @return_type_null
+    Member::BuildType.parse_type(return_type, null: nullable)
+  else
+    @type ||= Member::BuildType.parse_type(@return_type_expr, null: @return_type_null)
+  end
+rescue GraphQL::Schema::InvalidDocumentError, MissingReturnTypeError => err
+  # Let this propagate up
+  raise err
+rescue StandardError => err
+  raise MissingReturnTypeError, "Failed to build return type for #{@owner.graphql_name}.#{name} from #{@return_type_expr.inspect}: (#{err.class}) #{err.message}", err.backtrace
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .connection_extension(new_extension_class = nil) ⇒ Class + + + + + +

+
+

This extension is applied to fields when #connection? is true.

+ +

You can override it in your base field definition.

+ + +
+
+
+ +
+

Examples:

+ + +

Configuring a custom extension

+

+ +
class Types::BaseField < GraphQL::Schema::Field
+  connection_extension(MyCustomExtension)
+end
+ +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+175
+176
+177
+178
+179
+180
+181
+
+
# File 'lib/graphql/schema/field.rb', line 175
+
+def self.connection_extension(new_extension_class = nil)
+  if new_extension_class
+    @connection_extension = new_extension_class
+  else
+    @connection_extension ||= find_inherited_value(:connection_extension, ConnectionExtension)
+  end
+end
+
+
+ +
+

+ + .from_options(name = nil, type = nil, desc = nil, resolver: nil, mutation: nil, subscription: nil, **kwargs, &block) ⇒ GraphQL::Schema:Field + + + + + +

+
+

Create a field instance from a list of arguments, keyword arguments, and a block.

+ +

This method implements prioritization between the resolver or mutation defaults +and the local overrides via other keywords.

+ +

It also normalizes positional arguments into keywords for #initialize.

+ + +
+
+
+

Parameters:

+
    + +
  • + + resolver + + + (Class) + + + (defaults to: nil) + + + — +

    A Resolver class to use for field configuration

    +
    + +
  • + +
  • + + mutation + + + (Class) + + + (defaults to: nil) + + + — +

    A Mutation class to use for field configuration

    +
    + +
  • + +
  • + + subscription + + + (Class) + + + (defaults to: nil) + + + — +

    A Subscription class to use for field configuration

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (GraphQL::Schema:Field) + + + + — +

    an instance of self

    +
    + +
  • + +
+ +

See Also:

+
    + +
  • for other options
  • + +
+ +
+ + + + +
+
+
+
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+
+
# File 'lib/graphql/schema/field.rb', line 97
+
+def self.from_options(name = nil, type = nil, desc = nil, resolver: nil, mutation: nil, subscription: nil,**kwargs, &block)
+  if (resolver_class = resolver || mutation || subscription)
+    # Add a reference to that parent class
+    kwargs[:resolver_class] = resolver_class
+  end
+
+  if name
+    kwargs[:name] = name
+  end
+
+  if !type.nil?
+    if desc
+      if kwargs[:description]
+        raise ArgumentError, "Provide description as a positional argument or `description:` keyword, but not both (#{desc.inspect}, #{kwargs[:description].inspect})"
+      end
+
+      kwargs[:description] = desc
+      kwargs[:type] = type
+    elsif (resolver || mutation) && type.is_a?(String)
+      # The return type should be copied from the resolver, and the second positional argument is the description
+      kwargs[:description] = type
+    else
+      kwargs[:type] = type
+    end
+    if type.is_a?(Class) && type < GraphQL::Schema::Mutation
+      raise ArgumentError, "Use `field #{name.inspect}, mutation: Mutation, ...` to provide a mutation to this field instead"
+    end
+  end
+  new(**kwargs, &block)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #authorized?(object, args, context) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+
+
# File 'lib/graphql/schema/field.rb', line 609
+
+def authorized?(object, args, context)
+  if @resolver_class
+    # The resolver _instance_ will check itself during `resolve()`
+    @resolver_class.authorized?(object, context)
+  else
+    if args.size > 0
+      if (arg_values = context[:current_arguments])
+        # ^^ that's provided by the interpreter at runtime, and includes info about whether the default value was used or not.
+        using_arg_values = true
+        arg_values = arg_values.argument_values
+      else
+        arg_values = args
+        using_arg_values = false
+      end
+
+      args = context.warden.arguments(self)
+      args.each do |arg|
+        arg_key = arg.keyword
+        if arg_values.key?(arg_key)
+          arg_value = arg_values[arg_key]
+          if using_arg_values
+            if arg_value.default_used?
+              # pass -- no auth required for default used
+              next
+            else
+              application_arg_value = arg_value.value
+              if application_arg_value.is_a?(GraphQL::Execution::Interpreter::Arguments)
+                application_arg_value.keyword_arguments
+              end
+            end
+          else
+            application_arg_value = arg_value
+          end
+
+          if !arg.authorized?(object, application_arg_value, context)
+            return false
+          end
+        end
+      end
+    end
+    true
+  end
+end
+
+
+ +
+

+ + #broadcastable?Boolean? + + + + + +

+
+

If true, subscription updates with this field can be shared between viewers

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean, nil) + + + +
  • + +
+ +

See Also:

+ + +
+ + + + +
+
+
+
+360
+361
+362
+363
+364
+365
+366
+367
+368
+
+
# File 'lib/graphql/schema/field.rb', line 360
+
+def broadcastable?
+  if !NOT_CONFIGURED.equal?(@broadcastable)
+    @broadcastable
+  elsif @resolver_class
+    @resolver_class.broadcastable?
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #calculate_complexity(query:, nodes:, child_complexity:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+
+
# File 'lib/graphql/schema/field.rb', line 459
+
+def calculate_complexity(query:, nodes:, child_complexity:)
+  if respond_to?(:complexity_for)
+    lookahead = GraphQL::Execution::Lookahead.new(query: query, field: self, ast_nodes: nodes, owner_type: owner)
+    complexity_for(child_complexity: child_complexity, query: query, lookahead: lookahead)
+  elsif connection?
+    arguments = query.arguments_for(nodes.first, self)
+    max_possible_page_size = nil
+    if arguments.respond_to?(:[]) # It might have been an error
+      if arguments[:first]
+        max_possible_page_size = arguments[:first]
+      end
+
+      if arguments[:last] && (max_possible_page_size.nil? || arguments[:last] > max_possible_page_size)
+        max_possible_page_size = arguments[:last]
+      end
+    end
+
+    if max_possible_page_size.nil?
+      max_possible_page_size = default_page_size || query.schema.default_page_size || max_page_size || query.schema.default_max_page_size
+    end
+
+    if max_possible_page_size.nil?
+      raise GraphQL::Error, "Can't calculate complexity for #{path}, no `first:`, `last:`, `default_page_size`, `max_page_size` or `default_max_page_size`"
+    else
+       = 0
+      lookahead = GraphQL::Execution::Lookahead.new(query: query, field: self, ast_nodes: nodes, owner_type: owner)
+
+      if (page_info_lookahead = lookahead.selection(:page_info)).selected?
+         += 1 # pageInfo
+         += page_info_lookahead.selections.size # subfields
+      end
+
+      if lookahead.selects?(:total) || lookahead.selects?(:total_count) || lookahead.selects?(:count)
+         += 1
+      end
+
+      nodes_edges_complexity = 0
+      nodes_edges_complexity += 1 if lookahead.selects?(:edges)
+      nodes_edges_complexity += 1 if lookahead.selects?(:nodes)
+
+      # Possible bug: selections on `edges` and `nodes` are _both_ multiplied here. Should they be?
+      items_complexity = child_complexity -  - nodes_edges_complexity
+      # Add 1 for _this_ field
+      1 + (max_possible_page_size * items_complexity) +  + nodes_edges_complexity
+    end
+  else
+    defined_complexity = complexity
+    case defined_complexity
+    when Proc
+      arguments = query.arguments_for(nodes.first, self)
+      if arguments.is_a?(GraphQL::ExecutionError)
+        return child_complexity
+      elsif arguments.respond_to?(:keyword_arguments)
+        arguments = arguments.keyword_arguments
+      end
+
+      defined_complexity.call(query.context, arguments, child_complexity)
+    when Numeric
+      defined_complexity + child_complexity
+    else
+      raise("Invalid complexity: #{defined_complexity.inspect} on #{path} (#{inspect})")
+    end
+  end
+end
+
+
+ +
+

+ + #complexity(new_complexity = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+
+
# File 'lib/graphql/schema/field.rb', line 524
+
+def complexity(new_complexity = nil)
+  case new_complexity
+  when Proc
+    if new_complexity.parameters.size != 3
+      fail(
+        "A complexity proc should always accept 3 parameters: ctx, args, child_complexity. "\
+        "E.g.: complexity ->(ctx, args, child_complexity) { child_complexity * args[:limit] }"
+      )
+    else
+      @complexity = new_complexity
+    end
+  when Numeric
+    @complexity = new_complexity
+  when nil
+    if @resolver_class
+      @complexity || @resolver_class.complexity || 1
+    else
+      @complexity || 1
+    end
+  else
+    raise("Invalid complexity: #{new_complexity.inspect} on #{@name}")
+  end
+end
+
+
+ +
+

+ + #connection?Boolean + + + + + +

+
+

Can be set with connection: true|false or inferred from a type name ending in *Connection

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    if true, this field will be wrapped with Relay connection behavior

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+
+
# File 'lib/graphql/schema/field.rb', line 130
+
+def connection?
+  if @connection.nil?
+    # Provide default based on type name
+    return_type_name = if @return_type_expr
+      Member::BuildType.to_type_name(@return_type_expr)
+    elsif @resolver_class && @resolver_class.type
+      Member::BuildType.to_type_name(@resolver_class.type)
+    else
+      # As a last ditch, try to force loading the return type:
+      type.unwrap.name
+    end
+    @connection = return_type_name.end_with?("Connection") && return_type_name != "Connection"
+  else
+    @connection
+  end
+end
+
+
+ +
+

+ + #default_page_sizeInteger? + + + + + +

+
+

Returns Applied to connections if #has_default_page_size?.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+570
+571
+572
+573
+574
+575
+576
+577
+578
+
+
# File 'lib/graphql/schema/field.rb', line 570
+
+def default_page_size
+  if !NOT_CONFIGURED.equal?(@default_page_size)
+    @default_page_size
+  elsif @resolver_class && @resolver_class.has_default_page_size?
+    @resolver_class.default_page_size
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #extension(extension_class, options = nil) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Add extension to this field, initialized with options if provided.

+ + +
+
+
+ +
+

Examples:

+ + +

adding an extension

+

+ +
extension(MyExtensionClass)
+ + +

adding an extension with options

+

+ +
extension(MyExtensionClass, filter: true)
+ +
+

Parameters:

+
    + +
  • + + extension_class + + + (Class) + + + + — + + +
  • + +
  • + + options + + + (Hash) + + + (defaults to: nil) + + + — +

    if provided, given as options: when initializing extension.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+
+
# File 'lib/graphql/schema/field.rb', line 424
+
+def extension(extension_class, options = nil)
+  extension_inst = extension_class.new(field: self, options: options)
+  if @extensions.frozen?
+    @extensions = @extensions.dup
+  end
+  if @call_after_define
+    extension_inst.after_define_apply
+  end
+  @extensions << extension_inst
+  nil
+end
+
+
+ +
+

+ + #extensions(new_extensions = nil) ⇒ Array<GraphQL::Schema::FieldExtension> + + + + + +

+
+

Read extension instances from this field, +or add new classes/options to be initialized on this field. +Extensions are executed in the order they are added.

+ + +
+
+
+ +
+

Examples:

+ + +

adding an extension

+

+ +
extensions([MyExtensionClass])
+ + +

adding multiple extensions

+

+ +
extensions([MyExtensionClass, AnotherExtensionClass])
+ + +

adding an extension with options

+

+ +
extensions([MyExtensionClass, { AnotherExtensionClass => { filter: true } }])
+ +
+

Parameters:

+
    + +
  • + + extensions + + + (Array<Class, Hash<Class => Hash>>) + + + + — +

    Add extensions to this field. For hash elements, only the first key/value is used.

    +
    + +
  • + +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+
+
# File 'lib/graphql/schema/field.rb', line 399
+
+def extensions(new_extensions = nil)
+  if new_extensions
+    new_extensions.each do |extension_config|
+      if extension_config.is_a?(Hash)
+        extension_class, options = *extension_config.to_a[0]
+        self.extension(extension_class, options)
+      else
+        self.extension(extension_config)
+      end
+    end
+  end
+  @extensions
+end
+
+
+ +
+

+ + #extras(new_extras = nil) ⇒ Array<Symbol> + + + + + +

+
+

Read extras (as symbols) from this field, +or add new extras to be opted into by this field’s resolver.

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_extras + + + (Array<Symbol>) + + + (defaults to: nil) + + + — +

    Add extras to this field

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array<Symbol>) + + + +
  • + +
+ +
+ + + + +
+
+
+
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+
+
# File 'lib/graphql/schema/field.rb', line 441
+
+def extras(new_extras = nil)
+  if new_extras.nil?
+    # Read the value
+    field_extras = @extras
+    if @resolver_class && @resolver_class.extras.any?
+      field_extras + @resolver_class.extras
+    else
+      field_extras
+    end
+  else
+    if @extras.frozen?
+      @extras = @extras.dup
+    end
+    # Append to the set of extras on this field
+    @extras.concat(new_extras)
+  end
+end
+
+
+ +
+

+ + #fetch_extra(extra_name, ctx) ⇒ Object + + + + + +

+
+ + + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+764
+765
+766
+767
+768
+769
+770
+771
+772
+
+
# File 'lib/graphql/schema/field.rb', line 764
+
+def fetch_extra(extra_name, ctx)
+  if extra_name != :path && extra_name != :ast_node && respond_to?(extra_name)
+    self.public_send(extra_name)
+  elsif ctx.respond_to?(extra_name)
+    ctx.public_send(extra_name)
+  else
+    raise GraphQL::RequiredImplementationMissingError, "Unknown field extra for #{self.path}: #{extra_name.inspect}"
+  end
+end
+
+
+ +
+

+ + #has_default_page_size?Boolean + + + + + +

+
+

Returns True if this field’s #default_page_size should override the schema default.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if this field’s #default_page_size should override the schema default.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+565
+566
+567
+
+
# File 'lib/graphql/schema/field.rb', line 565
+
+def has_default_page_size?
+  !NOT_CONFIGURED.equal?(@default_page_size) || (@resolver_class && @resolver_class.has_default_page_size?)
+end
+
+
+ +
+

+ + #has_max_page_size?Boolean + + + + + +

+
+

Returns True if this field’s #max_page_size should override the schema default.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if this field’s #max_page_size should override the schema default.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+549
+550
+551
+
+
# File 'lib/graphql/schema/field.rb', line 549
+
+def has_max_page_size?
+  !NOT_CONFIGURED.equal?(@max_page_size) || (@resolver_class && @resolver_class.has_max_page_size?)
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+71
+72
+73
+
+
# File 'lib/graphql/schema/field.rb', line 71
+
+def inspect
+  "#<#{self.class} #{path}#{all_argument_definitions.any? ? "(...)" : ""}: #{type.to_type_signature}>"
+end
+
+
+ +
+

+ + #introspection?Boolean + + + + + +

+
+

Returns Is this field a predefined introspection field?.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Is this field a predefined introspection field?

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+67
+68
+69
+
+
# File 'lib/graphql/schema/field.rb', line 67
+
+def introspection?
+  @introspection
+end
+
+
+ +
+

+ + #max_page_sizeInteger? + + + + + +

+
+

Returns Applied to connections if #has_max_page_size?.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer, nil) + + + + — +

    Applied to connections if #has_max_page_size?

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+554
+555
+556
+557
+558
+559
+560
+561
+562
+
+
# File 'lib/graphql/schema/field.rb', line 554
+
+def max_page_size
+  if !NOT_CONFIGURED.equal?(@max_page_size)
+    @max_page_size
+  elsif @resolver_class && @resolver_class.has_max_page_size?
+    @resolver_class.max_page_size
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #method_conflict_warning?Boolean + + + + + +

+
+

Returns Should we warn if this field’s name conflicts with a built-in method?.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Should we warn if this field’s name conflicts with a built-in method?

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+189
+190
+191
+
+
# File 'lib/graphql/schema/field.rb', line 189
+
+def method_conflict_warning?
+  @method_conflict_warning
+end
+
+
+ +
+

+ + #owner_typeClass + + + + + +

+
+

Returns The GraphQL type this field belongs to. (For fields defined on mutations, it’s the payload type).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    The GraphQL type this field belongs to. (For fields defined on mutations, it’s the payload type)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+55
+56
+
+
# File 'lib/graphql/schema/field.rb', line 48
+
+def owner_type
+  @owner_type ||= if owner.nil?
+    raise GraphQL::InvariantError, "Field #{original_name.inspect} (graphql name: #{graphql_name.inspect}) has no owner, but all fields should have an owner. How did this happen?!"
+  elsif owner < GraphQL::Schema::Mutation
+    owner.payload_type
+  else
+    owner
+  end
+end
+
+
+ +
+

+ + #resolve(object, args, query_ctx) ⇒ Object + + + + + +

+
+

This method is called by the interpreter for each field. +You can extend it in your base field classes.

+ + +
+
+
+

Parameters:

+
    + +
  • + + object + + + (GraphQL::Schema::Object) + + + + — +

    An instance of some type class, wrapping an application object

    +
    + +
  • + +
  • + + args + + + (Hash) + + + + — +

    A symbol-keyed hash of Ruby keyword arguments. (Empty if no args)

    +
    + +
  • + +
  • + + ctx + + + (GraphQL::Query::Context) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+
+
# File 'lib/graphql/schema/field.rb', line 658
+
+def resolve(object, args, query_ctx)
+  # Unwrap the GraphQL object to get the application object.
+  application_object = object.object
+  method_receiver = nil
+  method_to_call = nil
+  method_args = nil
+
+  @own_validators && Schema::Validator.validate!(validators, application_object, query_ctx, args)
+
+  query_ctx.query.after_lazy(self.authorized?(application_object, args, query_ctx)) do |is_authorized|
+    if is_authorized
+      with_extensions(object, args, query_ctx) do |obj, ruby_kwargs|
+        method_args = ruby_kwargs
+        if @resolver_class
+          if obj.is_a?(GraphQL::Schema::Object)
+            obj = obj.object
+          end
+          obj = @resolver_class.new(object: obj, context: query_ctx, field: self)
+        end
+
+        inner_object = obj.object
+
+        if !NOT_CONFIGURED.equal?(@hash_key)
+          hash_value = if inner_object.is_a?(Hash)
+            inner_object.key?(@hash_key) ? inner_object[@hash_key] : inner_object[@hash_key_str]
+          elsif inner_object.respond_to?(:[])
+            inner_object[@hash_key]
+          else
+            nil
+          end
+          if hash_value == false
+            hash_value
+          else
+            hash_value || (@fallback_value != NOT_CONFIGURED ? @fallback_value : nil)
+          end
+        elsif obj.respond_to?(resolver_method)
+          method_to_call = resolver_method
+          method_receiver = obj
+          # Call the method with kwargs, if there are any
+          if ruby_kwargs.any?
+            obj.public_send(resolver_method, **ruby_kwargs)
+          else
+            obj.public_send(resolver_method)
+          end
+        elsif inner_object.is_a?(Hash)
+          if @dig_keys
+            inner_object.dig(*@dig_keys)
+          elsif inner_object.key?(@method_sym)
+            inner_object[@method_sym]
+          elsif inner_object.key?(@method_str) || !inner_object.default_proc.nil?
+            inner_object[@method_str]
+          elsif @fallback_value != NOT_CONFIGURED
+            @fallback_value
+          else
+            nil
+          end
+        elsif inner_object.respond_to?(@method_sym)
+          method_to_call = @method_sym
+          method_receiver = obj.object
+          if ruby_kwargs.any?
+            inner_object.public_send(@method_sym, **ruby_kwargs)
+          else
+            inner_object.public_send(@method_sym)
+          end
+        elsif @fallback_value != NOT_CONFIGURED
+          @fallback_value
+        else
+          raise <<-ERR
+        Failed to implement #{@owner.graphql_name}.#{@name}, tried:
+
+        - `#{obj.class}##{resolver_method}`, which did not exist
+        - `#{inner_object.class}##{@method_sym}`, which did not exist
+        - Looking up hash key `#{@method_sym.inspect}` or `#{@method_str.inspect}` on `#{inner_object}`, but it wasn't a Hash
+
+        To implement this field, define one of the methods above (and check for typos), or supply a `fallback_value`.
+        ERR
+        end
+      end
+    else
+      raise GraphQL::UnauthorizedFieldError.new(object: application_object, type: object.class, context: query_ctx, field: self)
+    end
+  end
+rescue GraphQL::UnauthorizedFieldError => err
+  err.field ||= self
+  begin
+    query_ctx.schema.unauthorized_field(err)
+  rescue GraphQL::ExecutionError => err
+    err
+  end
+rescue GraphQL::UnauthorizedError => err
+  begin
+    query_ctx.schema.unauthorized_object(err)
+  rescue GraphQL::ExecutionError => err
+    err
+  end
+rescue ArgumentError
+  if method_receiver && method_to_call
+    assert_satisfactory_implementation(method_receiver, method_to_call, method_args)
+  end
+  # if the line above doesn't raise, re-raise
+  raise
+rescue GraphQL::ExecutionError => err
+  err
+end
+
+
+ +
+

+ + #resolverClass? + + + + Also known as: + mutation + + + + +

+
+

Returns The Resolver this field was derived from, if there is one.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class, nil) + + + + — +

    The Resolver this field was derived from, if there is one

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+62
+63
+64
+
+
# File 'lib/graphql/schema/field.rb', line 62
+
+def resolver
+  @resolver_class
+end
+
+
+ +
+

+ + #resolver_methodSymbol + + + + + +

+
+

Returns The method on the type to look up.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Symbol) + + + + — +

    The method on the type to look up

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'lib/graphql/schema/field.rb', line 36
+
+def resolver_method
+  if @resolver_class
+    @resolver_class.resolver_method
+  else
+    @resolver_method
+  end
+end
+
+
+ +
+

+ + #scoped?Boolean + + + + + +

+
+

Returns if true, the return type’s .scope_items method will be applied to this field’s return value.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    if true, the return type’s .scope_items method will be applied to this field’s return value

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+
+
# File 'lib/graphql/schema/field.rb', line 148
+
+def scoped?
+  if !@scope.nil?
+    # The default was overridden
+    @scope
+  elsif @return_type_expr
+    # Detect a list return type, but don't call `type` since that may eager-load an otherwise lazy-loaded type
+    @return_type_expr.is_a?(Array) ||
+      (@return_type_expr.is_a?(String) && @return_type_expr.include?("[")) ||
+      connection?
+  elsif @resolver_class
+    resolver_type = @resolver_class.type_expr
+    resolver_type.is_a?(Array) ||
+      (resolver_type.is_a?(String) && resolver_type.include?("[")) ||
+      connection?
+  else
+    false
+  end
+end
+
+
+ +
+

+ + #visible?(context) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+601
+602
+603
+604
+605
+606
+607
+
+
# File 'lib/graphql/schema/field.rb', line 601
+
+def visible?(context)
+  if @resolver_class
+    @resolver_class.visible?(context)
+  else
+    true
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Field/ConnectionExtension.html b/api-doc/2.1.6/GraphQL/Schema/Field/ConnectionExtension.html new file mode 100644 index 0000000000..024d2187cb --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Field/ConnectionExtension.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::Schema::Field::ConnectionExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Field::ConnectionExtension + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::FieldExtension + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/field/connection_extension.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::FieldExtension

+

#added_default_arguments, #added_extras, #field, #options

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::FieldExtension

+

#after_define, #after_define_apply, default_argument, default_argument_configurations, extras, #initialize

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::FieldExtension

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #after_resolve(value:, object:, arguments:, context:, memo:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+
+
# File 'lib/graphql/schema/field/connection_extension.rb', line 24
+
+def after_resolve(value:, object:, arguments:, context:, memo:)
+  original_arguments = memo
+  # rename some inputs to avoid conflicts inside the block
+  maybe_lazy = value
+  value = nil
+  context.query.after_lazy(maybe_lazy) do |resolved_value|
+    value = resolved_value
+    if value.is_a? GraphQL::ExecutionError
+      # This isn't even going to work because context doesn't have ast_node anymore
+      context.add_error(value)
+      nil
+    elsif value.nil?
+      nil
+    elsif value.is_a?(GraphQL::Pagination::Connection)
+      # update the connection with some things that may not have been provided
+      value.context ||= context
+      value.parent ||= object.object
+      value.first_value ||= original_arguments[:first]
+      value.after_value ||= original_arguments[:after]
+      value.last_value ||= original_arguments[:last]
+      value.before_value ||= original_arguments[:before]
+      value.arguments ||= original_arguments # rubocop:disable Development/ContextIsPassedCop -- unrelated .arguments method
+      value.field ||= field
+      if field.has_max_page_size? && !value.has_max_page_size_override?
+        value.max_page_size = field.max_page_size
+      end
+      if field.has_default_page_size? && !value.has_default_page_size_override?
+        value.default_page_size = field.default_page_size
+      end
+      if context.schema.new_connections? && (custom_t = context.schema.connections.edge_class_for_field(@field))
+        value.edge_class = custom_t
+      end
+      value
+    else
+      context.namespace(:connections)[:all_wrappers] ||= context.schema.connections.all_wrappers
+      context.schema.connections.wrap(field, object.object, value, original_arguments, context)
+    end
+  end
+end
+
+
+ +
+

+ + #applyObject + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+
+
# File 'lib/graphql/schema/field/connection_extension.rb', line 7
+
+def apply
+  field.argument :after, "String", "Returns the elements in the list that come after the specified cursor.", required: false
+  field.argument :before, "String", "Returns the elements in the list that come before the specified cursor.", required: false
+  field.argument :first, "Int", "Returns the first _n_ elements from the list.", required: false
+  field.argument :last, "Int", "Returns the last _n_ elements from the list.", required: false
+end
+
+
+ +
+

+ + #resolve(object:, arguments:, context:) {|object, next_args, arguments| ... } ⇒ Object + + + + + +

+
+

Remove pagination args before passing it to a user method

+ + +
+
+
+ +

Yields:

+
    + +
  • + + + (object, next_args, arguments) + + + +
  • + +
+ +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/schema/field/connection_extension.rb', line 15
+
+def resolve(object:, arguments:, context:)
+  next_args = arguments.dup
+  next_args.delete(:first)
+  next_args.delete(:last)
+  next_args.delete(:before)
+  next_args.delete(:after)
+  yield(object, next_args, arguments)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Field/ExtendedState.html b/api-doc/2.1.6/GraphQL/Schema/Field/ExtendedState.html new file mode 100644 index 0000000000..8ab395e303 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Field/ExtendedState.html @@ -0,0 +1,489 @@ + + + + + + + Class: GraphQL::Schema::Field::ExtendedState + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Field::ExtendedState + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/field.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #added_extras ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute added_extras.

    +
    + +
  • + + +
  • + + + #arguments ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute arguments.

    +
    + +
  • + + +
  • + + + #memos ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute memos.

    +
    + +
  • + + +
  • + + + #object ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute object.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(args, object) ⇒ ExtendedState + + + + + +

+
+

Returns a new instance of ExtendedState.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+817
+818
+819
+820
+821
+822
+
+
# File 'lib/graphql/schema/field.rb', line 817
+
+def initialize(args, object)
+  @arguments = args
+  @object = object
+  @memos = nil
+  @added_extras = nil
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #added_extrasObject + + + + + +

+
+

Returns the value of attribute added_extras.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+824
+825
+826
+
+
# File 'lib/graphql/schema/field.rb', line 824
+
+def added_extras
+  @added_extras
+end
+
+
+ + + +
+

+ + #argumentsObject + + + + + +

+
+

Returns the value of attribute arguments.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+824
+825
+826
+
+
# File 'lib/graphql/schema/field.rb', line 824
+
+def arguments
+  @arguments
+end
+
+
+ + + +
+

+ + #memosObject + + + + + +

+
+

Returns the value of attribute memos.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+824
+825
+826
+
+
# File 'lib/graphql/schema/field.rb', line 824
+
+def memos
+  @memos
+end
+
+
+ + + +
+

+ + #objectObject + + + + + +

+
+

Returns the value of attribute object.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+824
+825
+826
+
+
# File 'lib/graphql/schema/field.rb', line 824
+
+def object
+  @object
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Field/FieldImplementationFailed.html b/api-doc/2.1.6/GraphQL/Schema/Field/FieldImplementationFailed.html new file mode 100644 index 0000000000..3f815dd086 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Field/FieldImplementationFailed.html @@ -0,0 +1,132 @@ + + + + + + + Exception: GraphQL::Schema::Field::FieldImplementationFailed + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::Field::FieldImplementationFailed + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/field.rb
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Field/MissingReturnTypeError.html b/api-doc/2.1.6/GraphQL/Schema/Field/MissingReturnTypeError.html new file mode 100644 index 0000000000..ef1c13ac39 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Field/MissingReturnTypeError.html @@ -0,0 +1,132 @@ + + + + + + + Exception: GraphQL::Schema::Field::MissingReturnTypeError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::Field::MissingReturnTypeError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/field.rb
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Field/ScopeExtension.html b/api-doc/2.1.6/GraphQL/Schema/Field/ScopeExtension.html new file mode 100644 index 0000000000..456b841031 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Field/ScopeExtension.html @@ -0,0 +1,247 @@ + + + + + + + Class: GraphQL::Schema::Field::ScopeExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Field::ScopeExtension + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::FieldExtension + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/field/scope_extension.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::FieldExtension

+

#added_default_arguments, #added_extras, #field, #options

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::FieldExtension

+

#after_define, #after_define_apply, #apply, default_argument, default_argument_configurations, extras, #initialize, #resolve

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::FieldExtension

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #after_resolve(object:, arguments:, context:, value:, memo:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/schema/field/scope_extension.rb', line 7
+
+def after_resolve(object:, arguments:, context:, value:, memo:)
+  if value.nil?
+    value
+  else
+    ret_type = @field.type.unwrap
+    if ret_type.respond_to?(:scope_items)
+      scoped_items = ret_type.scope_items(value, context)
+      if !scoped_items.equal?(value) && !ret_type.reauthorize_scoped_objects
+        if (current_runtime_state = Thread.current[:__graphql_runtime_info]) &&
+            (query_runtime_state = current_runtime_state[context.query])
+          query_runtime_state.was_authorized_by_scope_items = true
+        end
+      end
+      scoped_items
+    else
+      value
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/FieldExtension.html b/api-doc/2.1.6/GraphQL/Schema/FieldExtension.html new file mode 100644 index 0000000000..3155cb7cff --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/FieldExtension.html @@ -0,0 +1,1501 @@ + + + + + + + Class: GraphQL::Schema::FieldExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::FieldExtension + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/field_extension.rb
+
+ +
+ +

Overview

+
+

Extend this class to make field-level customizations to resolve behavior.

+ +

When a extension is added to a field with extension(MyExtension), a MyExtension instance +is created, and its hooks are applied whenever that field is called.

+ +

The instance is frozen so that instance variables aren’t modified during query execution, +which could cause all kinds of issues due to race conditions.

+ + +
+
+
+ + +
+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(field:, options:) ⇒ FieldExtension + + + + + +

+
+

Called when the extension is mounted with extension(name, options). +The instance will be frozen to avoid improper use of state during execution.

+ + +
+
+
+

Parameters:

+
    + +
  • + + field + + + (GraphQL::Schema::Field) + + + + — +

    The field where this extension was mounted

    +
    + +
  • + +
  • + + options + + + (Object) + + + + — +

    The second argument to extension, or {} if nothing was passed.

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+
+
# File 'lib/graphql/schema/field_extension.rb', line 25
+
+def initialize(field:, options:)
+  @field = field
+  @options = options || {}
+  @added_default_arguments = nil
+  apply
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #added_default_argumentsArray<Symbol>? (readonly) + + + + + +

+
+

Returns default_arguments added, if any were added (otherwise, nil).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<Symbol>, nil) + + + + — +

    default_arguments added, if any were added (otherwise, nil)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/schema/field_extension.rb', line 19
+
+def added_default_arguments
+  @added_default_arguments
+end
+
+
+ + + +
+

+ + #added_extrasObject (readonly) + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+117
+118
+119
+
+
# File 'lib/graphql/schema/field_extension.rb', line 117
+
+def added_extras
+  @added_extras
+end
+
+
+ + + +
+

+ + #fieldGraphQL::Schema::Field (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'lib/graphql/schema/field_extension.rb', line 13
+
+def field
+  @field
+end
+
+
+ + + +
+

+ + #optionsObject (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + +
  • + +
+ +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/schema/field_extension.rb', line 16
+
+def options
+  @options
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .default_argument(*argument_args, **argument_kwargs) ⇒ Object + + + + + +

+
+ + + +
+
+
+ + +

See Also:

+ + +
+ + + + +
+
+
+
+48
+49
+50
+51
+
+
# File 'lib/graphql/schema/field_extension.rb', line 48
+
+def default_argument(*argument_args, **argument_kwargs)
+  configs = @own_default_argument_configurations ||= []
+  configs << [argument_args, argument_kwargs]
+end
+
+
+ +
+

+ + .default_argument_configurationsArray(Array, Hash)? + + + + + +

+
+

Returns A list of default argument configs, or nil if there aren’t any.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array(Array, Hash), nil) + + + + — +

    A list of default argument configs, or nil if there aren’t any

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
+
# File 'lib/graphql/schema/field_extension.rb', line 34
+
+def default_argument_configurations
+  args = superclass.respond_to?(:default_argument_configurations) ? superclass.default_argument_configurations : nil
+  if @own_default_argument_configurations
+    if args
+      args.concat(@own_default_argument_configurations)
+    else
+      args = @own_default_argument_configurations.dup
+    end
+  end
+  args
+end
+
+
+ +
+

+ + .extras(new_extras = nil) ⇒ Array<Symbol> + + + + + +

+
+

If configured, these extras will be added to the field if they aren’t already present, +but removed by from arguments before the field’s resolve is called. +(The extras will be present for other extensions, though.)

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_extras + + + (Array<Symbol>) + + + (defaults to: nil) + + + — +

    If provided, assign extras used by this extension

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array<Symbol>) + + + + — +

    any extras assigned to this extension

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+
+
# File 'lib/graphql/schema/field_extension.rb', line 59
+
+def extras(new_extras = nil)
+  if new_extras
+    @own_extras = new_extras
+  end
+
+  inherited_extras = self.superclass.respond_to?(:extras) ? superclass.extras : nil
+  if @own_extras
+    if inherited_extras
+      inherited_extras + @own_extras
+    else
+      @own_extras
+    end
+  elsif inherited_extras
+    inherited_extras
+  else
+    GraphQL::EmptyObjects::EMPTY_ARRAY
+  end
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #after_definevoid + + + + + +

+
+

This method returns an undefined value.

Called after the field’s definition block has been executed. +(Any arguments from the block are present on field)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+88
+89
+
+
# File 'lib/graphql/schema/field_extension.rb', line 88
+
+def after_define
+end
+
+
+ +
+

+ + #after_define_applyObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+
+
# File 'lib/graphql/schema/field_extension.rb', line 92
+
+def after_define_apply
+  after_define
+  if (configs = self.class.default_argument_configurations)
+    existing_keywords = field.all_argument_definitions.map(&:keyword)
+    existing_keywords.uniq!
+    @added_default_arguments = []
+    configs.each do |config|
+      argument_args, argument_kwargs = config
+      arg_name = argument_args[0]
+      if !existing_keywords.include?(arg_name)
+        @added_default_arguments << arg_name
+        field.argument(*argument_args, **argument_kwargs)
+      end
+    end
+  end
+  if (extras = self.class.extras).any?
+    @added_extras = extras - field.extras
+    field.extras(@added_extras)
+  else
+    @added_extras = nil
+  end
+  freeze
+end
+
+
+ +
+

+ + #after_resolve(object:, arguments:, context:, value:, memo:) ⇒ Object + + + + + +

+
+

Called after #field was resolved, and after any lazy values (like Promises) were synced, +but before the value was added to the GraphQL response.

+ +

Whatever this hook returns will be used as the return value.

+ + +
+
+
+

Parameters:

+
    + +
  • + + object + + + (Object) + + + + — +

    The object the field is being resolved on

    +
    + +
  • + +
  • + + arguments + + + (Hash) + + + + — +

    Ruby keyword arguments for resolving this field

    +
    + +
  • + +
  • + + context + + + (Query::Context) + + + + — +

    the context for this query

    +
    + +
  • + +
  • + + value + + + (Object) + + + + — +

    Whatever the field previously returned

    +
    + +
  • + +
  • + + memo + + + (Object) + + + + — +

    The third value yielded by #resolve, or nil if there wasn’t one

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The return value for this field.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+148
+149
+150
+
+
# File 'lib/graphql/schema/field_extension.rb', line 148
+
+def after_resolve(object:, arguments:, context:, value:, memo:)
+  value
+end
+
+
+ +
+

+ + #applyvoid + + + + + +

+
+

This method returns an undefined value.

Called when this extension is attached to a field. +The field definition may be extended during this method.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+82
+83
+
+
# File 'lib/graphql/schema/field_extension.rb', line 82
+
+def apply
+end
+
+
+ +
+

+ + #resolve(object:, arguments:, context:) {|object, arguments, memo| ... } ⇒ Object + + + + + +

+
+

Called before resolving #field. It should either:

+ +
    +
  • yield values to continue execution; OR
  • +
  • return something else to shortcut field execution.
  • +
+ +

Whatever this method returns will be used for execution.

+ + +
+
+
+

Parameters:

+
    + +
  • + + object + + + (Object) + + + + — +

    The object the field is being resolved on

    +
    + +
  • + +
  • + + arguments + + + (Hash) + + + + — +

    Ruby keyword arguments for resolving this field

    +
    + +
  • + +
  • + + context + + + (Query::Context) + + + + — +

    the context for this query

    +
    + +
  • + +
+ +

Yield Parameters:

+
    + +
  • + + object + + + (Object) + + + + — +

    The object to continue resolving the field on

    +
    + +
  • + +
  • + + arguments + + + (Hash) + + + + — +

    The keyword arguments to continue resolving with

    +
    + +
  • + +
  • + + memo + + + (Object) + + + + — +

    Any extension-specific value which will be passed to #after_resolve later

    +
    + +
  • + +
+

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The return value for this field.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+133
+134
+135
+
+
# File 'lib/graphql/schema/field_extension.rb', line 133
+
+def resolve(object:, arguments:, context:)
+  yield(object, arguments, nil)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/FindInheritedValue.html b/api-doc/2.1.6/GraphQL/Schema/FindInheritedValue.html new file mode 100644 index 0000000000..b5cac1f644 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/FindInheritedValue.html @@ -0,0 +1,110 @@ + + + + + + + Module: GraphQL::Schema::FindInheritedValue + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::FindInheritedValue + + + +

+
+ + + + + + + + + +
+
Included in:
+
GraphQL::Schema, Field, Member::BaseDSLMethods
+
+ + + +
+
Defined in:
+
lib/graphql/schema/find_inherited_value.rb
+
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Finder.html b/api-doc/2.1.6/GraphQL/Schema/Finder.html new file mode 100644 index 0000000000..6b54dfaa00 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Finder.html @@ -0,0 +1,355 @@ + + + + + + + Class: GraphQL::Schema::Finder + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Finder + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/finder.rb
+
+ +
+ +

Overview

+
+

Find schema members using string paths

+ + +
+
+
+ +
+

Examples:

+ + +

Finding object types

+

+ +
MySchema.find("SomeObjectType")
+ + +

Finding fields

+

+ +
MySchema.find("SomeObjectType.myField")
+ + +

Finding arguments

+

+ +
MySchema.find("SomeObjectType.myField.anArgument")
+ + +

Finding directives

+

+ +
MySchema.find("@include")
+ +
+ + +

Defined Under Namespace

+

+ + + + + Classes: MemberNotFoundError + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(schema) ⇒ Finder + + + + + +

+
+

Returns a new instance of Finder.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/schema/finder.rb', line 22
+
+def initialize(schema)
+  @schema = schema
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #find(path) ⇒ Object + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
+
# File 'lib/graphql/schema/finder.rb', line 26
+
+def find(path)
+  path = path.split(".")
+  type_or_directive = path.shift
+
+  if type_or_directive.start_with?("@")
+    directive = schema.directives[type_or_directive[1..-1]]
+
+    if directive.nil?
+      raise MemberNotFoundError, "Could not find directive `#{type_or_directive}` in schema."
+    end
+
+    return directive if path.empty?
+
+    find_in_directive(directive, path: path)
+  else
+    type = schema.get_type(type_or_directive) # rubocop:disable Development/ContextIsPassedCop -- build-time
+
+    if type.nil?
+      raise MemberNotFoundError, "Could not find type `#{type_or_directive}` in schema."
+    end
+
+    return type if path.empty?
+
+    find_in_type(type, path: path)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Finder/MemberNotFoundError.html b/api-doc/2.1.6/GraphQL/Schema/Finder/MemberNotFoundError.html new file mode 100644 index 0000000000..00b04bee73 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Finder/MemberNotFoundError.html @@ -0,0 +1,124 @@ + + + + + + + Exception: GraphQL::Schema::Finder::MemberNotFoundError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::Finder::MemberNotFoundError + + + +

+
+ +
+
Inherits:
+
+ ArgumentError + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/finder.rb
+
+ +
+ + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/HasSingleInputArgument.html b/api-doc/2.1.6/GraphQL/Schema/HasSingleInputArgument.html new file mode 100644 index 0000000000..8df979b10a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/HasSingleInputArgument.html @@ -0,0 +1,254 @@ + + + + + + + Module: GraphQL::Schema::HasSingleInputArgument + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::HasSingleInputArgument + + + +

+
+ + + + + + + + + +
+
Included in:
+
RelayClassicMutation
+
+ + + +
+
Defined in:
+
lib/graphql/schema/has_single_input_argument.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: ClassMethods + + + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #resolve_with_support(**inputs) ⇒ Object + + + + + +

+ + + + +
+
+
+
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
+
# File 'lib/graphql/schema/has_single_input_argument.rb', line 6
+
+def resolve_with_support(**inputs)
+  if inputs[:input].is_a?(InputObject)
+    input = inputs[:input].to_kwargs
+  else
+    input = inputs[:input]
+  end
+
+  new_extras = field ? field.extras : []
+  all_extras = self.class.extras + new_extras
+
+  # Transfer these from the top-level hash to the
+  # shortcutted `input:` object
+  all_extras.each do |ext|
+    # It's possible that the `extra` was not passed along by this point,
+    # don't re-add it if it wasn't given here.
+    if inputs.key?(ext)
+      input[ext] = inputs[ext]
+    end
+  end
+
+  if input
+    # This is handled by Relay::Mutation::Resolve, a bit hacky, but here we are.
+    input_kwargs = input.to_h
+  else
+    # Relay Classic Mutations with no `argument`s
+    # don't require `input:`
+    input_kwargs = {}
+  end
+
+  if input_kwargs.any?
+    super(**input_kwargs)
+  else
+    super()
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/HasSingleInputArgument/ClassMethods.html b/api-doc/2.1.6/GraphQL/Schema/HasSingleInputArgument/ClassMethods.html new file mode 100644 index 0000000000..76f15eac3a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/HasSingleInputArgument/ClassMethods.html @@ -0,0 +1,790 @@ + + + + + + + Module: GraphQL::Schema::HasSingleInputArgument::ClassMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::HasSingleInputArgument::ClassMethods + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/has_single_input_argument.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #all_field_argument_definitionsObject + + + + + +

+ + + + +
+
+
+
+73
+74
+75
+
+
# File 'lib/graphql/schema/has_single_input_argument.rb', line 73
+
+def all_field_argument_definitions
+  dummy.all_argument_definitions
+end
+
+
+ +
+

+ + #any_field_arguments?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/graphql/schema/has_single_input_argument.rb', line 69
+
+def any_field_arguments?
+  dummy.any_arguments?
+end
+
+
+ +
+

+ + #argument(*args, own_argument: false, **kwargs, &block) ⇒ Object + + + + + +

+
+

Also apply this argument to the input type:

+ + +
+
+
+ + +
+ + + + +
+
+
+
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+
+
# File 'lib/graphql/schema/has_single_input_argument.rb', line 78
+
+def argument(*args, own_argument: false, **kwargs, &block)
+  it = input_type # make sure any inherited arguments are already added to it
+  arg = super(*args, **kwargs, &block)
+
+  # This definition might be overriding something inherited;
+  # if it is, remove the inherited definition so it's not confused at runtime as having multiple definitions
+  prev_args = it.own_arguments[arg.graphql_name]
+  case prev_args
+  when GraphQL::Schema::Argument
+    if prev_args.owner != self
+      it.own_arguments.delete(arg.graphql_name)
+    end
+  when Array
+    prev_args.reject! { |a| a.owner != self }
+    if prev_args.empty?
+      it.own_arguments.delete(arg.graphql_name)
+    end
+  end
+
+  it.add_argument(arg)
+  arg
+end
+
+
+ +
+

+ + #dummyObject + + + + + +

+ + + + +
+
+
+
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
+
# File 'lib/graphql/schema/has_single_input_argument.rb', line 47
+
+def dummy
+  @dummy ||= begin
+    d = Class.new(GraphQL::Schema::Resolver)
+    d.argument_class(self.argument_class)
+    # TODO make this lazier?
+    d.argument(:input, input_type, description: "Parameters for #{self.graphql_name}")
+    d
+  end
+end
+
+
+ +
+

+ + #field_arguments(context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/graphql/schema/has_single_input_argument.rb', line 57
+
+def field_arguments(context = GraphQL::Query::NullContext.instance)
+  dummy.arguments(context)
+end
+
+
+ +
+

+ + #get_field_argument(name, context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+ + + + +
+
+
+
+61
+62
+63
+
+
# File 'lib/graphql/schema/has_single_input_argument.rb', line 61
+
+def get_field_argument(name, context = GraphQL::Query::NullContext.instance)
+  dummy.get_argument(name, context)
+end
+
+
+ +
+

+ + #input_object_class(new_class = nil) ⇒ Class + + + + + +

+
+

The base class for generated input object types

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_class + + + (Class) + + + (defaults to: nil) + + + — +

    The base class to use for generating input object definitions

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    The base class for this mutation’s generated input object (default is InputObject)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+104
+105
+106
+107
+108
+109
+
+
# File 'lib/graphql/schema/has_single_input_argument.rb', line 104
+
+def input_object_class(new_class = nil)
+  if new_class
+    @input_object_class = new_class
+  end
+  @input_object_class || (superclass.respond_to?(:input_object_class) ? superclass.input_object_class : GraphQL::Schema::InputObject)
+end
+
+
+ +
+

+ + #input_type(new_input_type = nil) ⇒ Class + + + + + +

+
+

Returns The generated InputObject class for this mutation’s input.

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_input_type + + + (Class, nil) + + + (defaults to: nil) + + + — +

    If provided, it configures this mutation to accept new_input_type instead of generating an input type

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    The generated InputObject class for this mutation’s input

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+113
+114
+115
+116
+117
+118
+
+
# File 'lib/graphql/schema/has_single_input_argument.rb', line 113
+
+def input_type(new_input_type = nil)
+  if new_input_type
+    @input_type = new_input_type
+  end
+  @input_type ||= generate_input_type
+end
+
+
+ +
+

+ + #own_field_argumentsObject + + + + + +

+ + + + +
+
+
+
+65
+66
+67
+
+
# File 'lib/graphql/schema/has_single_input_argument.rb', line 65
+
+def own_field_arguments
+  dummy.own_arguments
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/InputObject.html b/api-doc/2.1.6/GraphQL/Schema/InputObject.html new file mode 100644 index 0000000000..4e8b903c91 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/InputObject.html @@ -0,0 +1,1857 @@ + + + + + + + Class: GraphQL::Schema::InputObject + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::InputObject + + + +

+
+ +
+
Inherits:
+
+ Member + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable, Member::HasArguments, Member::HasArguments::ArgumentObjectLoader, Member::HasValidators, Member::ValidatesInput
+
+ + + +
+
Includes:
+
Dig
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/input_object.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
INVALID_OBJECT_MESSAGE = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"Expected %{object} to be a key-value object responding to `to_h` or `to_unsafe_h`."
+ +
+ + + + + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + +

Methods included from Member::HasArguments

+

add_argument, all_argument_definitions, any_arguments?, argument, argument_class, arguments_statically_coercible?, coerce_arguments, get_argument, own_arguments, remove_argument, validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasArguments::ArgumentObjectLoader

+

authorize_application_object, load_and_authorize_application_object, load_application_object, load_application_object_failed, object_from_id

+ + + + + + + + + +

Methods included from Member::ValidatesInput

+

coerce_isolated_input, coerce_isolated_result, valid_input?, valid_isolated_input?, validate_input

+ + + + + + + + + +

Methods included from Member::HasValidators

+

validates, validators

+ + + + + + + + + + + + + + + +

Methods included from Dig

+

#dig

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(arguments, ruby_kwargs:, context:, defaults_used:) ⇒ InputObject + + + + + +

+
+

Returns a new instance of InputObject.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
+
# File 'lib/graphql/schema/input_object.rb', line 21
+
+def initialize(arguments, ruby_kwargs:, context:, defaults_used:)
+  @context = context
+  @ruby_style_hash = ruby_kwargs
+  @arguments = arguments
+  # Apply prepares, not great to have it duplicated here.
+  self.class.arguments(context).each_value do |arg_defn|
+    ruby_kwargs_key = arg_defn.keyword
+    if @ruby_style_hash.key?(ruby_kwargs_key)
+      # Weirdly, procs are applied during coercion, but not methods.
+      # Probably because these methods require a `self`.
+      if arg_defn.prepare.is_a?(Symbol) || context.nil?
+        prepared_value = arg_defn.prepare_value(self, @ruby_style_hash[ruby_kwargs_key])
+        overwrite_argument(ruby_kwargs_key, prepared_value)
+      end
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argumentsGraphQL::Execution::Interpereter::Arguments (readonly) + + + + + +

+
+

Returns The underlying arguments instance.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Execution::Interpereter::Arguments) + + + + — +

    The underlying arguments instance

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/schema/input_object.rb', line 16
+
+def arguments
+  @arguments
+end
+
+
+ + + +
+

+ + #contextGraphQL::Query::Context (readonly) + + + + + +

+
+

Returns The context for this query.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/schema/input_object.rb', line 14
+
+def context
+  @context
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .argument(*args, **kwargs, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+
+
# File 'lib/graphql/schema/input_object.rb', line 123
+
+def argument(*args, **kwargs, &block)
+  argument_defn = super(*args, **kwargs, &block)
+  if one_of?
+    if argument_defn.type.non_null?
+      raise ArgumentError, "Argument '#{argument_defn.path}' must be nullable because it is part of a OneOf type, add `required: false`."
+    end
+    if argument_defn.default_value?
+      raise ArgumentError, "Argument '#{argument_defn.path}' cannot have a default value because it is part of a OneOf type, remove `default_value: ...`."
+    end
+  end
+  # Add a method access
+  method_name = argument_defn.keyword
+  class_eval <<-RUBY, __FILE__, __LINE__
+    def #{method_name}
+      self[#{method_name.inspect}]
+    end
+  RUBY
+  argument_defn
+end
+
+
+ +
+

+ + .authorized?(obj, value, ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+
+
# File 'lib/graphql/schema/input_object.rb', line 58
+
+def self.authorized?(obj, value, ctx)
+  # Authorize each argument (but this doesn't apply if `prepare` is implemented):
+  if value.respond_to?(:key?)
+    arguments(ctx).each do |_name, input_obj_arg|
+      if value.key?(input_obj_arg.keyword) &&
+        !input_obj_arg.authorized?(obj, value[input_obj_arg.keyword], ctx)
+        return false
+      end
+    end
+  end
+  # It didn't early-return false:
+  true
+end
+
+
+ +
+

+ + .coerce_input(value, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+
+
# File 'lib/graphql/schema/input_object.rb', line 207
+
+def coerce_input(value, ctx)
+  if value.nil?
+    return nil
+  end
+
+  arguments = coerce_arguments(nil, value, ctx)
+
+  ctx.query.after_lazy(arguments) do |resolved_arguments|
+    if resolved_arguments.is_a?(GraphQL::Error)
+      raise resolved_arguments
+    else
+      input_obj_instance = self.new(resolved_arguments, ruby_kwargs: resolved_arguments.keyword_arguments, context: ctx, defaults_used: nil)
+      input_obj_instance.prepare
+    end
+  end
+end
+
+
+ +
+

+ + .coerce_result(value, ctx) ⇒ Object + + + + + +

+
+

It’s funny to think of a result of an input object. +This is used for rendering the default value in introspection responses.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+
+
# File 'lib/graphql/schema/input_object.rb', line 226
+
+def coerce_result(value, ctx)
+  # Allow the application to provide values as :snake_symbols, and convert them to the camelStrings
+  value = value.reduce({}) { |memo, (k, v)| memo[Member::BuildType.camelize(k.to_s)] = v; memo }
+
+  result = {}
+
+  arguments(ctx).each do |input_key, input_field_defn|
+    input_value = value[input_key]
+    if value.key?(input_key)
+      result[input_key] = if input_value.nil?
+        nil
+      else
+        input_field_defn.type.coerce_result(input_value, ctx)
+      end
+    end
+  end
+
+  result
+end
+
+
+ +
+

+ + .kindObject + + + + + +

+ + + + +
+
+
+
+143
+144
+145
+
+
# File 'lib/graphql/schema/input_object.rb', line 143
+
+def kind
+  GraphQL::TypeKinds::INPUT_OBJECT
+end
+
+
+ +
+

+ + .one_ofObject + + + + + +

+ + + + +
+
+
+
+72
+73
+74
+75
+76
+77
+78
+79
+
+
# File 'lib/graphql/schema/input_object.rb', line 72
+
+def self.one_of
+  if !one_of?
+    if all_argument_definitions.any? { |arg| arg.type.non_null? }
+      raise ArgumentError, "`one_of` may not be used with required arguments -- add `required: false` to argument definitions to use `one_of`"
+    end
+    directive(GraphQL::Schema::Directive::OneOf)
+  end
+end
+
+
+ +
+

+ + .one_of?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+81
+82
+83
+
+
# File 'lib/graphql/schema/input_object.rb', line 81
+
+def self.one_of?
+  false # Re-defined when `OneOf` is added
+end
+
+
+ +
+

+ + .validate_non_null_input(input, ctx, max_errors: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+
+
# File 'lib/graphql/schema/input_object.rb', line 150
+
+def validate_non_null_input(input, ctx, max_errors: nil)
+  warden = ctx.warden
+
+  if input.is_a?(Array)
+    return GraphQL::Query::InputValidationResult.from_problem(INVALID_OBJECT_MESSAGE % { object: JSON.generate(input, quirks_mode: true) })
+  end
+
+  if !(input.respond_to?(:to_h) || input.respond_to?(:to_unsafe_h))
+    # We're not sure it'll act like a hash, so reject it:
+    return GraphQL::Query::InputValidationResult.from_problem(INVALID_OBJECT_MESSAGE % { object: JSON.generate(input, quirks_mode: true) })
+  end
+
+  # Inject missing required arguments
+  missing_required_inputs = self.arguments(ctx).reduce({}) do |m, (argument_name, argument)|
+    if !input.key?(argument_name) && argument.type.non_null? && warden.get_argument(self, argument_name)
+      m[argument_name] = nil
+    end
+
+    m
+  end
+
+  result = nil
+  [input, missing_required_inputs].each do |args_to_validate|
+    args_to_validate.each do |argument_name, value|
+      argument = warden.get_argument(self, argument_name)
+      # Items in the input that are unexpected
+      if argument.nil?
+        result ||= Query::InputValidationResult.new
+        result.add_problem("Field is not defined on #{self.graphql_name}", [argument_name])
+      else
+        # Items in the input that are expected, but have invalid values
+        argument_result = argument.type.validate_input(value, ctx)
+        result ||= Query::InputValidationResult.new
+        if !argument_result.valid?
+          result.merge_result!(argument_name, argument_result)
+        end
+      end
+    end
+  end
+
+  if one_of?
+    if input.size == 1
+      input.each do |name, value|
+        if value.nil?
+          result ||= Query::InputValidationResult.new
+          result.add_problem("'#{graphql_name}' requires exactly one argument, but '#{name}' was `null`.")
+        end
+      end
+    else
+      result ||= Query::InputValidationResult.new
+      result.add_problem("'#{graphql_name}' requires exactly one argument, but #{input.size} were provided.")
+    end
+  end
+
+  result
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #[](key) ⇒ Object + + + + + +

+
+

Lookup a key on this object, it accepts new-style underscored symbols +Or old-style camelized identifiers.

+ + +
+
+
+

Parameters:

+
    + +
  • + + key + + + (Symbol, String) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+103
+104
+105
+106
+107
+108
+109
+110
+111
+
+
# File 'lib/graphql/schema/input_object.rb', line 103
+
+def [](key)
+  if @ruby_style_hash.key?(key)
+    @ruby_style_hash[key]
+  elsif @arguments
+    @arguments[key]
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #key?(key) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+113
+114
+115
+
+
# File 'lib/graphql/schema/input_object.rb', line 113
+
+def key?(key)
+  @ruby_style_hash.key?(key) || (@arguments && @arguments.key?(key)) || false
+end
+
+
+ +
+

+ + #prepareObject + + + + + +

+ + + + +
+
+
+
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+
+
# File 'lib/graphql/schema/input_object.rb', line 47
+
+def prepare
+  if @context
+    object = @context[:current_object]
+    # Pass this object's class with `as` so that messages are rendered correctly from inherited validators
+    Schema::Validator.validate!(self.class.validators, object, @context, @ruby_style_hash, as: self.class)
+    self
+  else
+    self
+  end
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+ + + + +
+
+
+
+39
+40
+41
+
+
# File 'lib/graphql/schema/input_object.rb', line 39
+
+def to_h
+  unwrap_value(@ruby_style_hash)
+end
+
+
+ +
+

+ + #to_hashObject + + + + + +

+ + + + +
+
+
+
+43
+44
+45
+
+
# File 'lib/graphql/schema/input_object.rb', line 43
+
+def to_hash
+  to_h
+end
+
+
+ +
+

+ + #to_kwargsObject + + + + + +

+
+

A copy of the Ruby-style hash

+ + +
+
+
+ + +
+ + + + +
+
+
+
+118
+119
+120
+
+
# File 'lib/graphql/schema/input_object.rb', line 118
+
+def to_kwargs
+  @ruby_style_hash.dup
+end
+
+
+ +
+

+ + #unwrap_value(value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+
+
# File 'lib/graphql/schema/input_object.rb', line 85
+
+def unwrap_value(value)
+  case value
+  when Array
+    value.map { |item| unwrap_value(item) }
+  when Hash
+    value.reduce({}) do |h, (key, value)|
+      h.merge!(key => unwrap_value(value))
+    end
+  when InputObject
+    value.to_h
+  else
+    value
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Interface.html b/api-doc/2.1.6/GraphQL/Schema/Interface.html new file mode 100644 index 0000000000..4eb041df88 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Interface.html @@ -0,0 +1,350 @@ + + + + + + + Module: GraphQL::Schema::Interface + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Interface + + + +

+
+ + + + +
+
Extended by:
+
DefinitionMethods
+
+ + + +
+
Includes:
+
Member::GraphQLTypeNames
+
+ + + + +
+
Included in:
+
Types::Relay::Node
+
+ + + +
+
Defined in:
+
lib/graphql/schema/interface.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: DefinitionMethods + + + + +

+ + + +

Constant Summary

+ +

Constants included + from Member::HasFields

+

Member::HasFields::CONFLICT_FIELD_NAMES, Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from DefinitionMethods

+

definition_methods, included, kind, orphan_types, type_membership_class, visible?

+ + + + + + + + + +

Methods included from Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + +
+

Instance Method Details

+ + +
+

+ + #unwrapObject + + + + + +

+ + + + +
+
+
+
+98
+99
+100
+
+
# File 'lib/graphql/schema/interface.rb', line 98
+
+def unwrap
+  self
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Interface/DefinitionMethods.html b/api-doc/2.1.6/GraphQL/Schema/Interface/DefinitionMethods.html new file mode 100644 index 0000000000..a9fb5f4c47 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Interface/DefinitionMethods.html @@ -0,0 +1,723 @@ + + + + + + + Module: GraphQL::Schema::Interface::DefinitionMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Interface::DefinitionMethods + + + +

+ + + + + +

Constant Summary

+ +

Constants included + from Member::HasFields

+

Member::HasFields::CONFLICT_FIELD_NAMES, Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Member::HasFields::RUBY_KEYWORDS

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name

+ + + + + + + + +
+

Instance Method Details

+ + +
+

+ + #definition_methods(&block) ⇒ Object + + + + + +

+
+

Methods defined in this block will be: +- Added as class methods to this interface +- Added as class methods to all child interfaces

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
+
# File 'lib/graphql/schema/interface.rb', line 22
+
+def definition_methods(&block)
+  # Use an instance variable to tell whether it's been included previously or not;
+  # You can't use constant detection because constants are brought into scope
+  # by `include`, which has already happened at this point.
+  if !defined?(@_definition_methods)
+    defn_methods_module = Module.new
+    @_definition_methods = defn_methods_module
+    const_set(:DefinitionMethods, defn_methods_module)
+    extend(self::DefinitionMethods)
+  end
+  self::DefinitionMethods.module_eval(&block)
+end
+
+
+ +
+

+ + #included(child_class) ⇒ Object + + + + + +

+
+

Here’s the tricky part. Make sure behavior keeps making its way down the inheritance chain.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+
+
# File 'lib/graphql/schema/interface.rb', line 49
+
+def included(child_class)
+  if !child_class.is_a?(Class)
+    # In this case, it's been included into another interface.
+    # This is how interface inheritance is implemented
+
+    # We need this before we can call `own_interfaces`
+    child_class.extend(Schema::Interface::DefinitionMethods)
+
+    child_class.type_membership_class(self.type_membership_class)
+    child_class.ancestors.reverse_each do |ancestor|
+      if ancestor.const_defined?(:DefinitionMethods) && ancestor != child_class
+        child_class.extend(ancestor::DefinitionMethods)
+      end
+    end
+
+    child_class.introspection(introspection)
+    child_class.description(description)
+    # If interfaces are mixed into each other, only define this class once
+    if !child_class.const_defined?(:UnresolvedTypeError, false)
+      add_unresolved_type_error(child_class)
+    end
+  elsif child_class < GraphQL::Schema::Object
+    # This is being included into an object type, make sure it's using `implements(...)`
+    backtrace_line = caller(0, 10).find { |line| line.include?("schema/member/has_interfaces.rb") && line.include?("in `implements'")}
+    if !backtrace_line
+      raise "Attach interfaces using `implements(#{self})`, not `include(#{self})`"
+    end
+  end
+
+  super
+end
+
+
+ +
+

+ + #kindObject + + + + + +

+ + + + +
+
+
+
+91
+92
+93
+
+
# File 'lib/graphql/schema/interface.rb', line 91
+
+def kind
+  GraphQL::TypeKinds::INTERFACE
+end
+
+
+ +
+

+ + #orphan_types(*types) ⇒ Object + + + + + +

+ + + + +
+
+
+
+81
+82
+83
+84
+85
+86
+87
+88
+89
+
+
# File 'lib/graphql/schema/interface.rb', line 81
+
+def orphan_types(*types)
+  if types.any?
+    @orphan_types = types
+  else
+    all_orphan_types = @orphan_types || []
+    all_orphan_types += super if defined?(super)
+    all_orphan_types.uniq
+  end
+end
+
+
+ +
+

+ + #type_membership_class(membership_class = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'lib/graphql/schema/interface.rb', line 40
+
+def type_membership_class(membership_class = nil)
+  if membership_class
+    @type_membership_class = membership_class
+  else
+    @type_membership_class || find_inherited_value(:type_membership_class, GraphQL::Schema::TypeMembership)
+  end
+end
+
+
+ +
+

+ + #visible?(context) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +

See Also:

+
    + +
  • hides interfaces without visible implementations
  • + +
+ +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/schema/interface.rb', line 36
+
+def visible?(context)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/IntrospectionSystem.html b/api-doc/2.1.6/GraphQL/Schema/IntrospectionSystem.html new file mode 100644 index 0000000000..465dcf5c88 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/IntrospectionSystem.html @@ -0,0 +1,767 @@ + + + + + + + Class: GraphQL::Schema::IntrospectionSystem + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::IntrospectionSystem + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/introspection_system.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: PerFieldProxyResolve + + +

+ + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #possible_types ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute possible_types.

    +
    + +
  • + + +
  • + + + #types ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute types.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(schema) ⇒ IntrospectionSystem + + + + + +

+
+

Returns a new instance of IntrospectionSystem.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/graphql/schema/introspection_system.rb', line 7
+
+def initialize(schema)
+  @schema = schema
+  @class_based = !!@schema.is_a?(Class)
+  @built_in_namespace = GraphQL::Introspection
+  @custom_namespace = if @class_based
+    schema.introspection || @built_in_namespace
+  else
+    schema.introspection_namespace || @built_in_namespace
+  end
+
+  type_defns = [
+    load_constant(:SchemaType),
+    load_constant(:TypeType),
+    load_constant(:FieldType),
+    load_constant(:DirectiveType),
+    load_constant(:EnumValueType),
+    load_constant(:InputValueType),
+    load_constant(:TypeKindEnum),
+    load_constant(:DirectiveLocationEnum)
+  ]
+  @types = {}
+  @possible_types = {}
+  type_defns.each do |t|
+    @types[t.graphql_name] = t
+    @possible_types[t.graphql_name] = [t]
+  end
+  @entry_point_fields =
+    if schema.disable_introspection_entry_points?
+      {}
+    else
+      entry_point_fields = get_fields_from_class(class_sym: :EntryPoints)
+      entry_point_fields.delete('__schema') if schema.disable_schema_introspection_entry_point?
+      entry_point_fields.delete('__type') if schema.disable_type_introspection_entry_point?
+      entry_point_fields
+    end
+  @entry_point_fields.each { |k, v| v.dynamic_introspection = true }
+  @dynamic_fields = get_fields_from_class(class_sym: :DynamicFields)
+  @dynamic_fields.each { |k, v| v.dynamic_introspection = true }
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #possible_typesObject (readonly) + + + + + +

+
+

Returns the value of attribute possible_types.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/schema/introspection_system.rb', line 5
+
+def possible_types
+  @possible_types
+end
+
+
+ + + +
+

+ + #typesObject (readonly) + + + + + +

+
+

Returns the value of attribute types.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/schema/introspection_system.rb', line 5
+
+def types
+  @types
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #dynamic_field(name:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+59
+60
+61
+
+
# File 'lib/graphql/schema/introspection_system.rb', line 59
+
+def dynamic_field(name:)
+  @dynamic_fields[name]
+end
+
+
+ +
+

+ + #dynamic_fieldsObject + + + + + +

+ + + + +
+
+
+
+55
+56
+57
+
+
# File 'lib/graphql/schema/introspection_system.rb', line 55
+
+def dynamic_fields
+  @dynamic_fields.values
+end
+
+
+ +
+

+ + #entry_point(name:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+51
+52
+53
+
+
# File 'lib/graphql/schema/introspection_system.rb', line 51
+
+def entry_point(name:)
+  @entry_point_fields[name]
+end
+
+
+ +
+

+ + #entry_pointsObject + + + + + +

+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/schema/introspection_system.rb', line 47
+
+def entry_points
+  @entry_point_fields.values
+end
+
+
+ +
+

+ + #resolve_late_bindingsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

The introspection system is prepared with a bunch of LateBoundTypes. +Replace those with the objects that they refer to, since LateBoundTypes +aren’t handled at runtime.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + + + + + +

    void

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+
+
# File 'lib/graphql/schema/introspection_system.rb', line 69
+
+def resolve_late_bindings
+  @types.each do |name, t|
+    if t.kind.fields?
+      t.fields.each do |_name, field_defn|
+        field_defn.type = resolve_late_binding(field_defn.type)
+      end
+    end
+  end
+
+  @entry_point_fields.each do |name, f|
+    f.type = resolve_late_binding(f.type)
+  end
+
+  @dynamic_fields.each do |name, f|
+    f.type = resolve_late_binding(f.type)
+  end
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/IntrospectionSystem/PerFieldProxyResolve.html b/api-doc/2.1.6/GraphQL/Schema/IntrospectionSystem/PerFieldProxyResolve.html new file mode 100644 index 0000000000..95102fac3f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/IntrospectionSystem/PerFieldProxyResolve.html @@ -0,0 +1,274 @@ + + + + + + + Class: GraphQL::Schema::IntrospectionSystem::PerFieldProxyResolve + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::IntrospectionSystem::PerFieldProxyResolve + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/introspection_system.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(object_class:, inner_resolve:) ⇒ PerFieldProxyResolve + + + + + +

+
+

Returns a new instance of PerFieldProxyResolve.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+149
+150
+151
+152
+
+
# File 'lib/graphql/schema/introspection_system.rb', line 149
+
+def initialize(object_class:, inner_resolve:)
+  @object_class = object_class
+  @inner_resolve = inner_resolve
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #call(obj, args, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+154
+155
+156
+157
+158
+159
+160
+161
+162
+
+
# File 'lib/graphql/schema/introspection_system.rb', line 154
+
+def call(obj, args, ctx)
+  query_ctx = ctx.query.context
+  # Remove the QueryType wrapper
+  if obj.is_a?(GraphQL::Schema::Object)
+    obj = obj.object
+  end
+  wrapped_object = @object_class.wrap(obj, query_ctx)
+  @inner_resolve.call(wrapped_object, args, ctx)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/InvalidDocumentError.html b/api-doc/2.1.6/GraphQL/Schema/InvalidDocumentError.html new file mode 100644 index 0000000000..eeeb1cd18b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/InvalidDocumentError.html @@ -0,0 +1,142 @@ + + + + + + + Exception: GraphQL::Schema::InvalidDocumentError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::InvalidDocumentError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema.rb
+
+ +
+ +

Overview

+
+

Error that is raised when [#Schema#from_definition] is passed an invalid schema definition string.

+ + +
+
+
+ + +
+ + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/InvalidTypeError.html b/api-doc/2.1.6/GraphQL/Schema/InvalidTypeError.html new file mode 100644 index 0000000000..39d479b894 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/InvalidTypeError.html @@ -0,0 +1,132 @@ + + + + + + + Exception: GraphQL::Schema::InvalidTypeError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::InvalidTypeError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/invalid_type_error.rb
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/LateBoundType.html b/api-doc/2.1.6/GraphQL/Schema/LateBoundType.html new file mode 100644 index 0000000000..5656daee66 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/LateBoundType.html @@ -0,0 +1,642 @@ + + + + + + + Class: GraphQL::Schema::LateBoundType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::LateBoundType + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/late_bound_type.rb
+
+ +
+ +

Overview

+
+

A stand-in for a type which will be resolved in a given schema, by name. +TODO: support argument types too, make this a public API somehow

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #name ⇒ Object + + + + (also: #graphql_name) + + + + + + + readonly + + + + + + + + + +
    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(local_name) ⇒ LateBoundType + + + + + +

+
+

Returns a new instance of LateBoundType.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/schema/late_bound_type.rb', line 10
+
+def initialize(local_name)
+  @name = local_name
+  @to_non_null_type = nil
+  @to_list_type = nil
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nameObject (readonly) + + + + Also known as: + graphql_name + + + + +

+
+ + + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/schema/late_bound_type.rb', line 8
+
+def name
+  @name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #inspectObject + + + + Also known as: + to_s + + + + +

+
+ + + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/schema/late_bound_type.rb', line 28
+
+def inspect
+  "#<LateBoundType @name=#{name}>"
+end
+
+
+ +
+

+ + #non_null?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/graphql/schema/late_bound_type.rb', line 32
+
+def non_null?
+  false
+end
+
+
+ +
+

+ + #to_list_typeObject + + + + + +

+
+ + + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/schema/late_bound_type.rb', line 24
+
+def to_list_type
+  @to_list_type ||= GraphQL::Schema::List.new(self)
+end
+
+
+ +
+

+ + #to_non_null_typeObject + + + + + +

+
+ + + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/schema/late_bound_type.rb', line 20
+
+def to_non_null_type
+  @to_non_null_type ||= GraphQL::Schema::NonNull.new(self)
+end
+
+
+ +
+

+ + #unwrapObject + + + + + +

+
+ + + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/schema/late_bound_type.rb', line 16
+
+def unwrap
+  self
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/List.html b/api-doc/2.1.6/GraphQL/Schema/List.html new file mode 100644 index 0000000000..f3a2b00478 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/List.html @@ -0,0 +1,739 @@ + + + + + + + Class: GraphQL::Schema::List + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::List + + + +

+
+ +
+
Inherits:
+
+ Wrapper + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Member::ValidatesInput
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/list.rb
+
+ +
+ +

Overview

+
+

Represents a list type in the schema. +Wraps a Member as a list type.

+ + +
+
+
+ + +

See Also:

+
    + +
  • {Schema{Schema::Member{Schema::Member::TypeSystemHelpers{Schema::Member::TypeSystemHelpers#to_list_type}
  • + +
+ +
+ + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Wrapper

+

#of_type

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + +

Methods inherited from Wrapper

+

#==, #initialize, #unwrap

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #non_null?, #to_list_type, #to_non_null_type

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Wrapper

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #coerce_input(value, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'lib/graphql/schema/list.rb', line 39
+
+def coerce_input(value, ctx)
+  if value.nil?
+    nil
+  else
+    coerced = ensure_array(value).map { |item| item.nil? ? item : of_type.coerce_input(item, ctx) }
+    ctx.schema.after_any_lazies(coerced, &:itself)
+  end
+end
+
+
+ +
+

+ + #coerce_result(value, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/graphql/schema/list.rb', line 35
+
+def coerce_result(value, ctx)
+  value.map { |i| i.nil? ? nil : of_type.coerce_result(i, ctx) }
+end
+
+
+ +
+

+ + #descriptionObject + + + + + +

+
+

Also for implementing introspection

+ + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'lib/graphql/schema/list.rb', line 31
+
+def description
+  nil
+end
+
+
+ +
+

+ + #graphql_nameObject + + + + + +

+
+

This is for introspection, where it’s expected the name will be null

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/schema/list.rb', line 26
+
+def graphql_name
+  nil
+end
+
+
+ +
+

+ + #kindGraphQL::TypeKinds::LIST + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::TypeKinds::LIST) + + + +
  • + +
+ +
+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/schema/list.rb', line 12
+
+def kind
+  GraphQL::TypeKinds::LIST
+end
+
+
+ +
+

+ + #list?true + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (true) + + + +
  • + +
+ +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/schema/list.rb', line 17
+
+def list?
+  true
+end
+
+
+ +
+

+ + #to_type_signatureObject + + + + + +

+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'lib/graphql/schema/list.rb', line 21
+
+def to_type_signature
+  "[#{@of_type.to_type_signature}]"
+end
+
+
+ +
+

+ + #validate_non_null_input(value, ctx, max_errors: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
+
# File 'lib/graphql/schema/list.rb', line 48
+
+def validate_non_null_input(value, ctx, max_errors: nil)
+  result = GraphQL::Query::InputValidationResult.new
+  ensure_array(value).each_with_index do |item, index|
+    item_result = of_type.validate_input(item, ctx)
+    unless item_result.valid?
+      if max_errors
+        if max_errors == 0
+          add_max_errros_reached_message(result)
+          break
+        end
+
+        max_errors -= 1
+      end
+
+      result.merge_result!(index, item_result)
+    end
+  end
+  result.valid? ? nil : result
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Loader.html b/api-doc/2.1.6/GraphQL/Schema/Loader.html new file mode 100644 index 0000000000..c41395f0bf --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Loader.html @@ -0,0 +1,542 @@ + + + + + + + Module: GraphQL::Schema::Loader + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Loader + + + +

+
+ + + + +
+
Extended by:
+
Loader
+
+ + + + + + +
+
Included in:
+
Loader
+
+ + + +
+
Defined in:
+
lib/graphql/schema/loader.rb
+
+ +
+ +

Overview

+
+

You can use the result of Introspection::INTROSPECTION_QUERY +to make a schema. This schema is missing some important details like +resolve functions, but it does include the full type system, +so you can use it to validate queries.

+ + +
+
+
+ + +

See Also:

+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
NullScalarCoerce = + +
+
->(val, _ctx) { val }
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .build_arguments(arg_owner, args, type_resolver) ⇒ Object + + + + + +

+ + + + +
+
+
+
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+
+
# File 'lib/graphql/schema/loader.rb', line 196
+
+def build_arguments(arg_owner, args, type_resolver)
+  args.each do |arg|
+    kwargs = {
+      type: type_resolver.call(arg["type"]),
+      description: arg["description"],
+      deprecation_reason: arg["deprecationReason"],
+      required: false,
+      camelize: false,
+    }
+
+    if arg["defaultValue"]
+      default_value_str = arg["defaultValue"]
+
+      dummy_query_str = "query getStuff($var: InputObj = #{default_value_str}) { __typename }"
+
+      # Returns a `GraphQL::Language::Nodes::Document`:
+      dummy_query_ast = GraphQL.parse(dummy_query_str)
+
+      # Reach into the AST for the default value:
+      input_value_ast = dummy_query_ast.definitions.first.variables.first.default_value
+
+      kwargs[:default_value] = extract_default_value(default_value_str, input_value_ast)
+    end
+
+    arg_owner.argument(arg["name"], **kwargs)
+  end
+end
+
+
+ +
+

+ + .build_fields(type_defn, fields, type_resolver) ⇒ Object + + + + + +

+ + + + +
+
+
+
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+
+
# File 'lib/graphql/schema/loader.rb', line 172
+
+def build_fields(type_defn, fields, type_resolver)
+  loader = self
+  fields.each do |field_hash|
+    unwrapped_field_hash = field_hash
+    while (of_type = unwrapped_field_hash["ofType"])
+      unwrapped_field_hash = of_type
+    end
+
+    type_defn.field(
+      field_hash["name"],
+      type: type_resolver.call(field_hash["type"]),
+      description: field_hash["description"],
+      deprecation_reason: field_hash["deprecationReason"],
+      null: true,
+      camelize: false,
+      connection_extension: nil,
+    ) do
+      if field_hash["args"].any?
+        loader.build_arguments(self, field_hash["args"], type_resolver)
+      end
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #load(introspection_result) ⇒ Class + + + + + +

+
+

Create schema with the result of an introspection query.

+ + +
+
+
+

Parameters:

+ + +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    the schema described by input

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
+
# File 'lib/graphql/schema/loader.rb', line 16
+
+def load(introspection_result)
+  schema = introspection_result.fetch("data").fetch("__schema")
+
+  types = {}
+  type_resolver = ->(type) { resolve_type(types, type) }
+
+  schema.fetch("types").each do |type|
+    next if type.fetch("name").start_with?("__")
+    type_object = define_type(type, type_resolver)
+    types[type["name"]] = type_object
+  end
+
+  directives = []
+  schema.fetch("directives", []).each do |directive|
+    next if GraphQL::Schema.default_directives.include?(directive.fetch("name"))
+    directives << define_directive(directive, type_resolver)
+  end
+
+  Class.new(GraphQL::Schema) do
+    orphan_types(types.values)
+    directives(directives)
+    description(schema["description"])
+
+    def self.resolve_type(*)
+      raise(GraphQL::RequiredImplementationMissingError, "This schema was loaded from string, so it can't resolve types for objects")
+    end
+
+    [:query, :mutation, :subscription].each do |root|
+      type = schema["#{root}Type"]
+      if type
+        type_defn = types.fetch(type.fetch("name"))
+        self.public_send(root, type_defn)
+      end
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member.html b/api-doc/2.1.6/GraphQL/Schema/Member.html new file mode 100644 index 0000000000..9837db17f8 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member.html @@ -0,0 +1,278 @@ + + + + + + + Class: GraphQL::Schema::Member + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Member + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
BaseDSLMethods, BaseDSLMethods::ConfigurationExtension, HasAstNode, HasDirectives, HasPath, RelayShortcuts, Scoped, TypeSystemHelpers
+
+ + + +
+
Includes:
+
GraphQLTypeNames
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/member.rb,
+ lib/graphql/schema/member/scoped.rb,
lib/graphql/schema/member/has_path.rb,
lib/graphql/schema/member/build_type.rb,
lib/graphql/schema/member/has_fields.rb,
lib/graphql/schema/member/has_ast_node.rb,
lib/graphql/schema/member/has_arguments.rb,
lib/graphql/schema/member/has_directives.rb,
lib/graphql/schema/member/has_interfaces.rb,
lib/graphql/schema/member/has_validators.rb,
lib/graphql/schema/member/relay_shortcuts.rb,
lib/graphql/schema/member/validates_input.rb,
lib/graphql/schema/member/base_dsl_methods.rb,
lib/graphql/schema/member/graphql_type_names.rb,
lib/graphql/schema/member/type_system_helpers.rb,
lib/graphql/schema/member/has_deprecation_reason.rb,
lib/graphql/schema/member/has_unresolved_type_error.rb
+
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

The base class for things that make up the schema, +eg objects, enums, scalars.

+ + +
+
+
+ + +
+

Direct Known Subclasses

+

Directive, Enum, EnumValue, InputObject, Object, Scalar, Union

+
+

Defined Under Namespace

+

+ + + Modules: BaseDSLMethods, BuildType, GraphQLTypeNames, HasArguments, HasAstNode, HasDeprecationReason, HasDirectives, HasFields, HasInterfaces, HasPath, HasUnresolvedTypeError, HasValidators, RelayShortcuts, Scoped, TypeSystemHelpers, ValidatesInput + + + + +

+ + + +

Constant Summary

+ +

Constants included + from GraphQLTypeNames

+

GraphQLTypeNames::Boolean, GraphQLTypeNames::ID, GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from HasAstNode

+

#ast_node

+ + + + + + + + + +

Method Summary

+ +

Methods included from BaseDSLMethods

+

authorized?, default_relay, description, introspection, introspection?, mutation, name, visible?

+ + + + + + + + + + + + + + + +

Methods included from BaseDSLMethods::ConfigurationExtension

+

inherited

+ + + + + + + + + +

Methods included from TypeSystemHelpers

+

initialize, kind, list?, non_null?, to_list_type, to_non_null_type, to_type_signature

+ + + + + + + + + +

Methods included from Scoped

+

inherited, reauthorize_scoped_objects, scope_items

+ + + + + + + + + + + + + + + +

Methods included from HasPath

+

path

+ + + + + + + + + +

Methods included from HasAstNode

+

inherited

+ + + + + + + + + +

Methods included from HasDirectives

+

add_directive, directive, directives, get_directives, inherited, remove_directive, remove_directive

+ + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/BaseDSLMethods.html b/api-doc/2.1.6/GraphQL/Schema/Member/BaseDSLMethods.html new file mode 100644 index 0000000000..ca3a33505a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/BaseDSLMethods.html @@ -0,0 +1,1062 @@ + + + + + + + Module: GraphQL::Schema::Member::BaseDSLMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::BaseDSLMethods + + + Private +

+
+ + + + + + +
+
Includes:
+
FindInheritedValue
+
+ + + + +
+
Included in:
+
Interface::DefinitionMethods, GraphQL::Schema::Member, Resolver
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/base_dsl_methods.rb
+
+ +
+ +

Overview

+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+

DSL methods shared by lots of things in the GraphQL Schema.

+ + +
+
+
+ + +

See Also:

+
    + +
  • that extend this, eg {GraphQL::Schema::Object}
  • + +
+ +

Defined Under Namespace

+

+ + + Modules: ConfigurationExtension + + + + +

+ + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #default_graphql_name ⇒ Object + + + + + + + + + readonly + + + + + + + private + + +

    Creates the default name for a schema member.

    +
    + +
  • + + +
  • + + + #graphql_name(new_name = nil) ⇒ String + + + + + + + + + readonly + + + + + + + private + + +

    Call this with a new name to override the default name for this schema member; OR call it without an argument to get the name of this schema member.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #default_graphql_nameObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Creates the default name for a schema member. +The default name is the Ruby constant name, +without any namespaces and with any -Type suffix removed

+ + +
+
+
+ + +
+ + + + +
+
+
+
+102
+103
+104
+105
+106
+107
+108
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 102
+
+def default_graphql_name
+  @default_graphql_name ||= begin
+    raise GraphQL::RequiredImplementationMissingError, 'Anonymous class should declare a `graphql_name`' if name.nil?
+    g_name = -name.split("::").last
+    g_name.end_with?("Type") ? g_name.sub(/Type\Z/, "") : g_name
+  end
+end
+
+
+ + + +
+

+ + #graphql_name(new_name = nil) ⇒ String + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Call this with a new name to override the default name for this schema member; OR +call it without an argument to get the name of this schema member

+ +

The default name is implemented in default_graphql_name

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_name + + + (String) + + + (defaults to: nil) + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+20
+21
+22
+23
+24
+25
+26
+27
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 20
+
+def graphql_name(new_name = nil)
+  if new_name
+    GraphQL::NameValidator.validate!(new_name)
+    @graphql_name = new_name
+  else
+    @graphql_name ||= default_graphql_name
+  end
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #authorized?(object, context) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+114
+115
+116
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 114
+
+def authorized?(object, context)
+  true
+end
+
+
+ +
+

+ + #default_relayObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+118
+119
+120
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 118
+
+def default_relay
+  false
+end
+
+
+ +
+

+ + #description(new_description = nil) ⇒ String + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Call this method to provide a new description; OR +call it without an argument to get the description

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_description + + + (String) + + + (defaults to: nil) + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 43
+
+def description(new_description = nil)
+  if new_description
+    @description = new_description
+  elsif defined?(@description)
+    @description
+  else
+    @description = nil
+  end
+end
+
+
+ +
+

+ + #introspection(new_introspection = nil) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns If true, this object is part of the introspection system.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    If true, this object is part of the introspection system

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+71
+72
+73
+74
+75
+76
+77
+78
+79
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 71
+
+def introspection(new_introspection = nil)
+  if !new_introspection.nil?
+    @introspection = new_introspection
+  elsif defined?(@introspection)
+    @introspection
+  else
+    false
+  end
+end
+
+
+ +
+

+ + #introspection?Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+81
+82
+83
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 81
+
+def introspection?
+  !!@introspection
+end
+
+
+ +
+

+ + #mutation(mutation_class = nil) ⇒ Class + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

The mutation this type was derived from, if it was derived from a mutation

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + +
  • + +
+ +
+ + + + +
+
+
+
+87
+88
+89
+90
+91
+92
+93
+94
+95
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 87
+
+def mutation(mutation_class = nil)
+  if mutation_class
+    @mutation = mutation_class
+  elsif defined?(@mutation)
+    @mutation
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #name(new_name = nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Just a convenience method to point out that people should use graphql_name instead

+ + +
+
+
+ + +
+ + + + +
+
+
+
+30
+31
+32
+33
+34
+35
+36
+37
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 30
+
+def name(new_name = nil)
+  return super() if new_name.nil?
+
+  fail(
+    "The new name override method is `graphql_name`, not `name`. Usage: "\
+    "graphql_name \"#{new_name}\""
+  )
+end
+
+
+ +
+

+ + #visible?(context) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+110
+111
+112
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 110
+
+def visible?(context)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/BaseDSLMethods/ConfigurationExtension.html b/api-doc/2.1.6/GraphQL/Schema/Member/BaseDSLMethods/ConfigurationExtension.html new file mode 100644 index 0000000000..f74accc3d8 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/BaseDSLMethods/ConfigurationExtension.html @@ -0,0 +1,227 @@ + + + + + + + Module: GraphQL::Schema::Member::BaseDSLMethods::ConfigurationExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::BaseDSLMethods::ConfigurationExtension + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
GraphQL::Schema::Member
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/base_dsl_methods.rb
+
+ +
+ +

Overview

+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+

This pushes some configurations down the inheritance tree, +in order to prevent repetitive lookups at runtime.

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #inherited(child_class) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
+
# File 'lib/graphql/schema/member/base_dsl_methods.rb', line 56
+
+def inherited(child_class)
+  child_class.introspection(introspection)
+  child_class.description(description)
+  child_class.default_graphql_name = nil
+
+  if defined?(@graphql_name) && @graphql_name && (self.name.nil? || graphql_name != default_graphql_name)
+    child_class.graphql_name(graphql_name)
+  else
+    child_class.graphql_name = nil
+  end
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/BuildType.html b/api-doc/2.1.6/GraphQL/Schema/Member/BuildType.html new file mode 100644 index 0000000000..abea5fc4f2 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/BuildType.html @@ -0,0 +1,831 @@ + + + + + + + Module: GraphQL::Schema::Member::BuildType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::BuildType + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/member/build_type.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
LIST_TYPE_ERROR = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"Use an array of [T] or [T, null: true] for list types; other arrays are not supported"
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .camelize(string) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+
+
# File 'lib/graphql/schema/member/build_type.rb', line 127
+
+def camelize(string)
+  return string if string == '_'
+  return string unless string.include?("_")
+  camelized = string.split('_').each(&:capitalize!).join
+  camelized[0] = camelized[0].downcase
+  if string.start_with?("_")
+    match_data = string.match(/\A(_+)/)
+    camelized = "#{match_data[0]}#{camelized}"
+  end
+  camelized
+end
+
+
+ +
+

+ + .constantize(string) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Resolves constant from string (based on Rails ActiveSupport::Inflector.constantize)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+
+
# File 'lib/graphql/schema/member/build_type.rb', line 140
+
+def constantize(string)
+  names = string.split('::')
+
+  # Trigger a built-in NameError exception including the ill-formed constant in the message.
+  Object.const_get(string) if names.empty?
+
+  # Remove the first blank element in case of '::ClassName' notation.
+  names.shift if names.size > 1 && names.first.empty?
+
+  names.inject(Object) do |constant, name|
+    if constant == Object
+      constant.const_get(name)
+    else
+      candidate = constant.const_get(name)
+      next candidate if constant.const_defined?(name, false)
+      next candidate unless Object.const_defined?(name)
+
+      # Go down the ancestors to check if it is owned directly. The check
+      # stops when we reach Object or the end of ancestors tree.
+      constant = constant.ancestors.inject do |const, ancestor|
+        break const    if ancestor == Object
+        break ancestor if ancestor.const_defined?(name, false)
+        const
+      end
+
+      # Owner is in Object, so raise.
+      constant.const_get(name, false)
+    end
+  end
+end
+
+
+ +
+

+ + .parse_type(type_expr, null:) ⇒ GraphQL::BaseType + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+

Parameters:

+
    + +
  • + + type_expr + + + (String, Class, GraphQL::BaseType) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (GraphQL::BaseType) + + + +
  • + +
+ +
+ + + + +
+
+
+
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+
+
# File 'lib/graphql/schema/member/build_type.rb', line 12
+
+def parse_type(type_expr, null:)
+  list_type = false
+
+  return_type = case type_expr
+  when String
+    case type_expr
+    when "String"
+      GraphQL::Types::String
+    when "Int", "Integer"
+      GraphQL::Types::Int
+    when "Float"
+      GraphQL::Types::Float
+    when "Boolean"
+      GraphQL::Types::Boolean
+    when "ID"
+      GraphQL::Types::ID
+    when /\A\[.*\]\Z/
+      list_type = true
+      # List members are required by default
+      parse_type(type_expr[1..-2], null: false)
+    when /.*!\Z/
+      null = false
+      parse_type(type_expr[0..-2], null: true)
+    else
+      maybe_type = constantize(type_expr)
+      case maybe_type
+      when Module
+        # This is a way to check that it's the right kind of module:
+        if maybe_type.respond_to?(:kind)
+          maybe_type
+        else
+          raise ArgumentError, "Unexpected class/module found for GraphQL type: #{type_expr} (must be type definition class/module)"
+        end
+      end
+    end
+  when GraphQL::Schema::LateBoundType
+    type_expr
+  when Array
+    case type_expr.length
+    when 1
+      list_type = true
+      # List members are required by default
+      parse_type(type_expr.first, null: false)
+    when 2
+      inner_type, nullable_option = type_expr
+      if nullable_option.keys != [:null] || (nullable_option[:null] != true && nullable_option[:null] != false)
+        raise ArgumentError, LIST_TYPE_ERROR
+      end
+      list_type = true
+      parse_type(inner_type, null: nullable_option[:null])
+    else
+      raise ArgumentError, LIST_TYPE_ERROR
+    end
+  when GraphQL::Schema::NonNull, GraphQL::Schema::List
+    type_expr
+  when Module
+    # This is a way to check that it's the right kind of module:
+    if type_expr.respond_to?(:kind)
+      type_expr
+    else
+      # Eg `String` => GraphQL::Types::String
+      parse_type(type_expr.name, null: true)
+    end
+  when Proc
+    parse_type(type_expr.call, null: true)
+  when false
+    raise ArgumentError, "Received `false` instead of a type, maybe a `!` should be replaced with `null: true` (for fields) or `required: true` (for arguments)"
+  end
+
+  if return_type.nil?
+    raise "Unexpected type input: #{type_expr.inspect} (#{type_expr.class})"
+  end
+
+  # Apply list_type first, that way the
+  # .to_non_null_type applies to the list type, not the inner type
+  if list_type
+    return_type = return_type.to_list_type
+  end
+
+  if !null
+    return_type = return_type.to_non_null_type
+  end
+
+
+  return_type
+end
+
+
+ +
+

+ + .to_type_name(something) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+
+
# File 'lib/graphql/schema/member/build_type.rb', line 99
+
+def to_type_name(something)
+  case something
+  when GraphQL::Schema::LateBoundType
+    something.unwrap.name
+  when Array
+    to_type_name(something.first)
+  when Module
+    if something.respond_to?(:graphql_name)
+      something.graphql_name
+    else
+      to_type_name(something.name)
+    end
+  when String
+    if something.include?("]") ||
+        something.include?("[") ||
+        something.include?("!") ||
+        something.include?("::")
+      something.gsub(/\]\[\!/, "").split("::").last
+    else
+      something
+    end
+  when GraphQL::Schema::NonNull, GraphQL::Schema::List
+    to_type_name(something.unwrap)
+  else
+    raise "Unhandled to_type_name input: #{something} (#{something.class})"
+  end
+end
+
+
+ +
+

+ + .underscore(string) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+
+
# File 'lib/graphql/schema/member/build_type.rb', line 171
+
+def underscore(string)
+  if string.match?(/\A[a-z_]+\Z/)
+    return string
+  end
+  string2 = string.dup
+
+  string2.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2') # URLDecoder -> URL_Decoder
+  string2.gsub!(/([a-z\d])([A-Z])/,'\1_\2')     # someThing -> some_Thing
+  string2.downcase!
+
+  string2
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/GraphQLTypeNames.html b/api-doc/2.1.6/GraphQL/Schema/Member/GraphQLTypeNames.html new file mode 100644 index 0000000000..91dac4b143 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/GraphQLTypeNames.html @@ -0,0 +1,202 @@ + + + + + + + Module: GraphQL::Schema::Member::GraphQLTypeNames + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::GraphQLTypeNames + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Interface, GraphQL::Schema::Member, Resolver
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/graphql_type_names.rb
+
+ +
+ +

Overview

+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+

These constants are interpreted as GraphQL types when defining fields or arguments

+ + +
+
+
+ +
+

Examples:

+ + +
field :is_draft, Boolean, null: false
+field :id, ID, null: false
+field :score, Int, null: false
+ +
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
Boolean = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"Boolean"
+ +
ID = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"ID"
+ +
Int = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"Int"
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments.html new file mode 100644 index 0000000000..90cc1b9610 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments.html @@ -0,0 +1,1474 @@ + + + + + + + Module: GraphQL::Schema::Member::HasArguments + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasArguments + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Directive, Field, InputObject, Resolver
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_arguments.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: ArgumentClassAccessor, ArgumentObjectLoader, ClassConfigured, FieldConfigured, HasDirectiveArguments + + + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
NO_ARGUMENTS = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
GraphQL::EmptyObjects::EMPTY_HASH
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #add_argument(arg_defn) ⇒ GraphQL::Schema::Argument + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Register this argument with the class.

+ + +
+
+
+

Parameters:

+ + +

Returns:

+ + +
+ + + + +
+
+
+
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 80
+
+def add_argument(arg_defn)
+  @own_arguments ||= {}
+  prev_defn = @own_arguments[arg_defn.name]
+  case prev_defn
+  when nil
+    @own_arguments[arg_defn.name] = arg_defn
+  when Array
+    prev_defn << arg_defn
+  when GraphQL::Schema::Argument
+    @own_arguments[arg_defn.name] = [prev_defn, arg_defn]
+  else
+    raise "Invariant: unexpected `@own_arguments[#{arg_defn.name.inspect}]`: #{prev_defn.inspect}"
+  end
+  arg_defn
+end
+
+
+ +
+

+ + #all_argument_definitionsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+232
+233
+234
+235
+236
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 232
+
+def all_argument_definitions
+  all_defns = own_arguments.values
+  all_defns.flatten!
+  all_defns
+end
+
+
+ +
+

+ + #any_arguments?Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+125
+126
+127
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 125
+
+def any_arguments?
+  own_arguments.any?
+end
+
+
+ +
+

+ + #argument(*args, **kwargs, &block) ⇒ GraphQL::Schema::Argument + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns An instance of #argument_class, created from *args.

+ + +
+
+
+ +

Returns:

+ + +

See Also:

+
    + +
  • for parameters
  • + +
+ +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 19
+
+def argument(*args, **kwargs, &block)
+  kwargs[:owner] = self
+  loads = kwargs[:loads]
+  if loads
+    name = args[0]
+    name_as_string = name.to_s
+
+    inferred_arg_name = case name_as_string
+    when /_id$/
+      name_as_string.sub(/_id$/, "").to_sym
+    when /_ids$/
+      name_as_string.sub(/_ids$/, "")
+        .sub(/([^s])$/, "\\1s")
+        .to_sym
+    else
+      name
+    end
+
+    kwargs[:as] ||= inferred_arg_name
+  end
+  arg_defn = self.argument_class.new(*args, **kwargs, &block)
+  add_argument(arg_defn)
+
+  if self.is_a?(Class) && !method_defined?(:"load_#{arg_defn.keyword}")
+    method_owner = if self < GraphQL::Schema::InputObject || self < GraphQL::Schema::Directive
+      "self."
+    elsif self < GraphQL::Schema::Resolver
+      ""
+    else
+      raise "Unexpected argument owner: #{self}"
+    end
+    if loads && arg_defn.type.list?
+      class_eval <<-RUBY, __FILE__, __LINE__ + 1
+      def #{method_owner}load_#{arg_defn.keyword}(values, context = nil)
+        argument = get_argument("#{arg_defn.graphql_name}")
+        (context || self.context).query.after_lazy(values) do |values2|
+          GraphQL::Execution::Lazy.all(values2.map { |value| load_application_object(argument, value, context || self.context) })
+        end
+      end
+      RUBY
+    elsif loads
+      class_eval <<-RUBY, __FILE__, __LINE__ + 1
+      def #{method_owner}load_#{arg_defn.keyword}(value, context = nil)
+        argument = get_argument("#{arg_defn.graphql_name}")
+        load_application_object(argument, value, context || self.context)
+      end
+      RUBY
+    else
+      class_eval <<-RUBY, __FILE__, __LINE__ + 1
+      def #{method_owner}load_#{arg_defn.keyword}(value, _context = nil)
+        value
+      end
+      RUBY
+    end
+  end
+  arg_defn
+end
+
+
+ +
+

+ + #argument_class(new_arg_class = nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+

Parameters:

+
    + +
  • + + new_arg_class + + + (Class) + + + (defaults to: nil) + + + — +

    A class to use for building argument definitions

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+251
+252
+253
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 251
+
+def argument_class(new_arg_class = nil)
+  self.class.argument_class(new_arg_class)
+end
+
+
+ +
+

+ + #arguments(context = GraphQL::Query::NullContext.instance) ⇒ Hash<String => GraphQL::Schema::Argument] Arguments defined on this thing, keyed by name. Includes inherited definitions + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Hash<String => GraphQL::Schema::Argument] Arguments defined on this thing, keyed by name. Includes inherited definitions.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<String => GraphQL::Schema::Argument] Arguments defined on this thing, keyed by name. Includes inherited definitions) + + + + — +

    Hash<String => GraphQL::Schema::Argument] Arguments defined on this thing, keyed by name. Includes inherited definitions

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 112
+
+def arguments(context = GraphQL::Query::NullContext.instance)
+  if own_arguments.any?
+    own_arguments_that_apply = {}
+    own_arguments.each do |name, args_entry|
+      if (visible_defn = Warden.visible_entry?(:visible_argument?, args_entry, context))
+        own_arguments_that_apply[visible_defn.graphql_name] = visible_defn
+      end
+    end
+  end
+  # might be nil if there are actually no arguments
+  own_arguments_that_apply || own_arguments
+end
+
+
+ +
+

+ + #arguments_statically_coercible?Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+334
+335
+336
+337
+338
+339
+340
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 334
+
+def arguments_statically_coercible?
+  if defined?(@arguments_statically_coercible) && !@arguments_statically_coercible.nil?
+    @arguments_statically_coercible
+  else
+    @arguments_statically_coercible = all_argument_definitions.all?(&:statically_coercible?)
+  end
+end
+
+
+ +
+

+ + #coerce_arguments(parent_object, values, context) {|Interpreter::Arguments, Execution::Lazy<Interpeter::Arguments>| ... } ⇒ Interpreter::Arguments, Execution::Lazy<Interpeter::Arguments> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

If given a block, it will eventually yield the loaded args to the block.

+ +

If no block is given, it will immediately dataload (but might return a Lazy).

+ + +
+
+
+

Parameters:

+ + +

Yields:

+
    + +
  • + + + (Interpreter::Arguments, Execution::Lazy<Interpeter::Arguments>) + + + +
  • + +
+

Returns:

+
    + +
  • + + + (Interpreter::Arguments, Execution::Lazy<Interpeter::Arguments>) + + + +
  • + +
+ +
+ + + + +
+
+
+
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 264
+
+def coerce_arguments(parent_object, values, context, &block)
+  # Cache this hash to avoid re-merging it
+  arg_defns = context.warden.arguments(self)
+  total_args_count = arg_defns.size
+
+  finished_args = nil
+  prepare_finished_args = -> {
+    if total_args_count == 0
+      finished_args = GraphQL::Execution::Interpreter::Arguments::EMPTY
+      if block_given?
+        block.call(finished_args)
+      end
+    else
+      argument_values = {}
+      resolved_args_count = 0
+      raised_error = false
+      arg_defns.each do |arg_defn|
+        context.dataloader.append_job do
+          begin
+            arg_defn.coerce_into_values(parent_object, values, context, argument_values)
+          rescue GraphQL::ExecutionError, GraphQL::UnauthorizedError => err
+            raised_error = true
+            finished_args = err
+            if block_given?
+              block.call(finished_args)
+            end
+          end
+
+          resolved_args_count += 1
+          if resolved_args_count == total_args_count && !raised_error
+            finished_args = context.schema.after_any_lazies(argument_values.values) {
+              GraphQL::Execution::Interpreter::Arguments.new(
+                argument_values: argument_values,
+              )
+            }
+            if block_given?
+              block.call(finished_args)
+            end
+          end
+        end
+      end
+    end
+  }
+
+  if block_given?
+    prepare_finished_args.call
+    nil
+  else
+    # This API returns eagerly, gotta run it now
+    context.dataloader.run_isolated(&prepare_finished_args)
+    finished_args
+  end
+end
+
+
+ +
+

+ + #get_argument(argument_name, context = GraphQL::Query::NullContext.instance) ⇒ GraphQL::Schema::Argument? + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Argument defined on this thing, fetched by name.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 239
+
+def get_argument(argument_name, context = GraphQL::Query::NullContext.instance)
+  warden = Warden.from_context(context)
+  if (arg_config = own_arguments[argument_name]) && (visible_arg = Warden.visible_entry?(:visible_argument?, arg_config, context, warden))
+    visible_arg
+  elsif defined?(@resolver_class) && @resolver_class
+    @resolver_class.get_field_argument(argument_name, context)
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #own_argumentsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+442
+443
+444
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 442
+
+def own_arguments
+  @own_arguments || NO_ARGUMENTS
+end
+
+
+ +
+

+ + #remove_argument(arg_defn) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 96
+
+def remove_argument(arg_defn)
+  prev_defn = @own_arguments[arg_defn.name]
+  case prev_defn
+  when nil
+    # done
+  when Array
+    prev_defn.delete(arg_defn)
+  when GraphQL::Schema::Argument
+    @own_arguments.delete(arg_defn.name)
+  else
+    raise "Invariant: unexpected `@own_arguments[#{arg_defn.name.inspect}]`: #{prev_defn.inspect}"
+  end
+  nil
+end
+
+
+ +
+

+ + #validate_directive_argument(arg_defn, value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Usually, this is validated statically by RequiredArgumentsArePresent, +but not for directives. +TODO apply static validations on schema definitions?

+ + +
+
+
+ + +
+ + + + +
+
+
+
+321
+322
+323
+324
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 321
+
+def validate_directive_argument(arg_defn, value)
+  # this is only implemented on directives.
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ArgumentClassAccessor.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ArgumentClassAccessor.html new file mode 100644 index 0000000000..a53c2b4fa7 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ArgumentClassAccessor.html @@ -0,0 +1,215 @@ + + + + + + + Module: GraphQL::Schema::Member::HasArguments::ArgumentClassAccessor + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasArguments::ArgumentClassAccessor + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/member/has_arguments.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #argument_class(new_arg_class = nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+343
+344
+345
+346
+347
+348
+349
+350
+351
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 343
+
+def argument_class(new_arg_class = nil)
+  if new_arg_class
+    @argument_class = new_arg_class
+  elsif defined?(@argument_class) && @argument_class
+    @argument_class
+  else
+    superclass.respond_to?(:argument_class) ? superclass.argument_class : GraphQL::Schema::Argument
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ArgumentObjectLoader.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ArgumentObjectLoader.html new file mode 100644 index 0000000000..860758112d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ArgumentObjectLoader.html @@ -0,0 +1,643 @@ + + + + + + + Module: GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
InputObject
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_arguments.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #authorize_application_object(argument, id, context, loaded_application_object) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 379
+
+def authorize_application_object(argument, id, context, loaded_application_object)
+  context.query.after_lazy(loaded_application_object) do |application_object|
+    if application_object.nil?
+      err = GraphQL::LoadApplicationObjectFailedError.new(context: context, argument: argument, id: id, object: application_object)
+      application_object = load_application_object_failed(err)
+    end
+    # Double-check that the located object is actually of this type
+    # (Don't want to allow arbitrary access to objects this way)
+    if application_object.nil?
+      nil
+    else
+      maybe_lazy_resolve_type = context.schema.resolve_type(argument.loads, application_object, context)
+      context.query.after_lazy(maybe_lazy_resolve_type) do |resolve_type_result|
+        if resolve_type_result.is_a?(Array) && resolve_type_result.size == 2
+          application_object_type, application_object = resolve_type_result
+        else
+          application_object_type = resolve_type_result
+          # application_object is already assigned
+        end
+
+        if !(
+            context.warden.possible_types(argument.loads).include?(application_object_type) ||
+            context.warden.loadable?(argument.loads, context)
+          )
+          err = GraphQL::LoadApplicationObjectFailedError.new(context: context, argument: argument, id: id, object: application_object)
+          application_object = load_application_object_failed(err)
+        end
+
+        if application_object.nil?
+          nil
+        else
+          # This object was loaded successfully
+          # and resolved to the right type,
+          # now apply the `.authorized?` class method if there is one
+          context.query.after_lazy(application_object_type.authorized?(application_object, context)) do |authed|
+            if authed
+              application_object
+            else
+              err = GraphQL::UnauthorizedError.new(
+                object: application_object,
+                type: application_object_type,
+                context: context,
+              )
+              if self.respond_to?(:unauthorized_object)
+                err.set_backtrace(caller)
+                unauthorized_object(err)
+              else
+                raise err
+              end
+            end
+          end
+        end
+      end
+    end
+  end
+end
+
+
+ +
+

+ + #load_and_authorize_application_object(argument, id, context) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+374
+375
+376
+377
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 374
+
+def load_and_authorize_application_object(argument, id, context)
+  loaded_application_object = load_application_object(argument, id, context)
+  authorize_application_object(argument, id, context, loaded_application_object)
+end
+
+
+ +
+

+ + #load_application_object(argument, id, context) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+366
+367
+368
+369
+370
+371
+372
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 366
+
+def load_application_object(argument, id, context)
+  # See if any object can be found for this ID
+  if id.nil?
+    return nil
+  end
+  object_from_id(argument.loads, id, context)
+end
+
+
+ +
+

+ + #load_application_object_failed(err) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+436
+437
+438
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 436
+
+def load_application_object_failed(err)
+  raise err
+end
+
+
+ +
+

+ + #object_from_id(type, id, context) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Look up the corresponding object for a provided ID. +By default, it uses Relay-style GraphQL::Schema.object_from_id, +override this to find objects another way.

+ + +
+
+
+

Parameters:

+
    + +
  • + + type + + + (Class, Module) + + + + — +

    A GraphQL type definition

    +
    + +
  • + +
  • + + id + + + (String) + + + + — +

    A client-provided to look up

    +
    + +
  • + +
  • + + context + + + (GraphQL::Query::Context) + + + + — +

    the current context

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+362
+363
+364
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 362
+
+def object_from_id(type, id, context)
+  context.schema.object_from_id(id, context)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ClassConfigured.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ClassConfigured.html new file mode 100644 index 0000000000..471229212a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ClassConfigured.html @@ -0,0 +1,215 @@ + + + + + + + Module: GraphQL::Schema::Member::HasArguments::ClassConfigured + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasArguments::ClassConfigured + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/member/has_arguments.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: InheritedArguments + + + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #inherited(child_class) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+130
+131
+132
+133
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 130
+
+def inherited(child_class)
+  super
+  child_class.extend(InheritedArguments)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ClassConfigured/InheritedArguments.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ClassConfigured/InheritedArguments.html new file mode 100644 index 0000000000..115ba5b969 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/ClassConfigured/InheritedArguments.html @@ -0,0 +1,473 @@ + + + + + + + Module: GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/member/has_arguments.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #all_argument_definitionsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 156
+
+def all_argument_definitions
+  all_defns = {}
+  ancestors.reverse_each do |ancestor|
+    if ancestor.respond_to?(:own_arguments)
+      all_defns.merge!(ancestor.own_arguments)
+    end
+  end
+  all_defns = all_defns.values
+  all_defns.flatten!
+  all_defns
+end
+
+
+ +
+

+ + #any_arguments?Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+152
+153
+154
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 152
+
+def any_arguments?
+  super || superclass.any_arguments?
+end
+
+
+ +
+

+ + #arguments(context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 136
+
+def arguments(context = GraphQL::Query::NullContext.instance)
+  own_arguments = super
+  inherited_arguments = superclass.arguments(context)
+
+  if own_arguments.any?
+    if inherited_arguments.any?
+      # Local definitions override inherited ones
+      inherited_arguments.merge(own_arguments)
+    else
+      own_arguments
+    end
+  else
+    inherited_arguments
+  end
+end
+
+
+ +
+

+ + #get_argument(argument_name, context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 169
+
+def get_argument(argument_name, context = GraphQL::Query::NullContext.instance)
+  warden = Warden.from_context(context)
+  for ancestor in ancestors
+    if ancestor.respond_to?(:own_arguments) &&
+      (a = ancestor.own_arguments[argument_name]) &&
+      (a = Warden.visible_entry?(:visible_argument?, a, context, warden))
+      return a
+    end
+  end
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/FieldConfigured.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/FieldConfigured.html new file mode 100644 index 0000000000..f3234a233a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/FieldConfigured.html @@ -0,0 +1,425 @@ + + + + + + + Module: GraphQL::Schema::Member::HasArguments::FieldConfigured + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasArguments::FieldConfigured + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Field
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_arguments.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #all_argument_definitionsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 206
+
+def all_argument_definitions
+  if @resolver_class
+    all_defns = {}
+    @resolver_class.all_field_argument_definitions.each do |arg_defn|
+      key = arg_defn.graphql_name
+      case (current_value = all_defns[key])
+      when nil
+        all_defns[key] = arg_defn
+      when Array
+        current_value << arg_defn
+      when GraphQL::Schema::Argument
+        all_defns[key] = [current_value, arg_defn]
+      else
+        raise "Invariant: Unexpected argument definition, #{current_value.class}: #{current_value.inspect}"
+      end
+    end
+    all_defns.merge!(own_arguments)
+    all_defns = all_defns.values
+    all_defns.flatten!
+    all_defns
+  else
+    super
+  end
+end
+
+
+ +
+

+ + #any_arguments?Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+202
+203
+204
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 202
+
+def any_arguments?
+  super || (@resolver_class && @resolver_class.any_field_arguments?)
+end
+
+
+ +
+

+ + #arguments(context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 184
+
+def arguments(context = GraphQL::Query::NullContext.instance)
+  own_arguments = super
+  if @resolver_class
+    inherited_arguments = @resolver_class.field_arguments(context)
+    if own_arguments.any?
+      if inherited_arguments.any?
+        inherited_arguments.merge(own_arguments)
+      else
+        own_arguments
+      end
+    else
+      inherited_arguments
+    end
+  else
+    own_arguments
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/HasDirectiveArguments.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/HasDirectiveArguments.html new file mode 100644 index 0000000000..1e79a8f422 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasArguments/HasDirectiveArguments.html @@ -0,0 +1,212 @@ + + + + + + + Module: GraphQL::Schema::Member::HasArguments::HasDirectiveArguments + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasArguments::HasDirectiveArguments + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Directive
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_arguments.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #validate_directive_argument(arg_defn, value) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+327
+328
+329
+330
+331
+
+
# File 'lib/graphql/schema/member/has_arguments.rb', line 327
+
+def validate_directive_argument(arg_defn, value)
+  if value.nil? && arg_defn.type.non_null?
+    raise ArgumentError, "#{arg_defn.path} is required, but no value was given"
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasAstNode.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasAstNode.html new file mode 100644 index 0000000000..8446287b20 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasAstNode.html @@ -0,0 +1,305 @@ + + + + + + + Module: GraphQL::Schema::Member::HasAstNode + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasAstNode + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
GraphQL::Schema, Argument, EnumValue, Field, Interface::DefinitionMethods, GraphQL::Schema::Member
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_ast_node.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #ast_node(new_ast_node = nil) ⇒ Object + + + + + + + + + + + + + + private + + +

    If this schema was parsed from a .graphql file (or other SDL), this is the AST node that defined this part of the schema.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #ast_node(new_ast_node = nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

If this schema was parsed from a .graphql file (or other SDL), +this is the AST node that defined this part of the schema.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
+
# File 'lib/graphql/schema/member/has_ast_node.rb', line 18
+
+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
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #inherited(child_cls) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+
+
# File 'lib/graphql/schema/member/has_ast_node.rb', line 11
+
+def inherited(child_cls)
+  super
+  child_cls.ast_node = nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasDeprecationReason.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasDeprecationReason.html new file mode 100644 index 0000000000..e964525e93 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasDeprecationReason.html @@ -0,0 +1,223 @@ + + + + + + + Module: GraphQL::Schema::Member::HasDeprecationReason + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasDeprecationReason + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Argument, EnumValue, Field
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_deprecation_reason.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #deprecation_reason ⇒ String? + + + + + + + + + + + + + + private + + +

    Explains why this member was deprecated (if present, this will be marked deprecated in introspection).

    +
    + +
  • + + +
+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #deprecation_reasonString? + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Explains why this member was deprecated (if present, this will be marked deprecated in introspection).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String, nil) + + + + — +

    Explains why this member was deprecated (if present, this will be marked deprecated in introspection)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/schema/member/has_deprecation_reason.rb', line 8
+
+def deprecation_reason
+  @deprecation_reason
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasDirectives.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasDirectives.html new file mode 100644 index 0000000000..0934e8859f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasDirectives.html @@ -0,0 +1,739 @@ + + + + + + + Module: GraphQL::Schema::Member::HasDirectives + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasDirectives + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Argument, EnumValue, Field, Interface::DefinitionMethods, GraphQL::Schema::Member
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_directives.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .add_directive(schema_member, directives, directive_class, directive_options) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+41
+42
+43
+44
+
+
# File 'lib/graphql/schema/member/has_directives.rb', line 41
+
+def add_directive(schema_member, directives, directive_class, directive_options)
+  remove_directive(directives, directive_class) unless directive_class.repeatable?
+  directives << directive_class.new(schema_member, **directive_options)
+end
+
+
+ +
+

+ + .get_directives(schema_member, directives, directives_method) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+
+
# File 'lib/graphql/schema/member/has_directives.rb', line 50
+
+def get_directives(schema_member, directives, directives_method)
+  case schema_member
+  when Class
+    inherited_directives = if schema_member.superclass.respond_to?(directives_method)
+      get_directives(schema_member.superclass, schema_member.superclass.public_send(directives_method), directives_method)
+    else
+      GraphQL::EmptyObjects::EMPTY_ARRAY
+    end
+    if inherited_directives.any? && directives
+      dirs = []
+      merge_directives(dirs, inherited_directives)
+      merge_directives(dirs, directives)
+      dirs
+    elsif directives
+      directives
+    elsif inherited_directives.any?
+      inherited_directives
+    else
+      GraphQL::EmptyObjects::EMPTY_ARRAY
+    end
+  when Module
+    dirs = nil
+    schema_member.ancestors.reverse_each do |ancestor|
+      if ancestor.respond_to?(:own_directives) &&
+          (anc_dirs = ancestor.own_directives).any?
+        dirs ||= []
+        merge_directives(dirs, anc_dirs)
+      end
+    end
+    if directives
+      dirs ||= []
+      merge_directives(dirs, directives)
+    end
+    dirs || GraphQL::EmptyObjects::EMPTY_ARRAY
+  when HasDirectives
+    directives || GraphQL::EmptyObjects::EMPTY_ARRAY
+  else
+    raise "Invariant: how could #{schema_member} not be a Class, Module, or instance of HasDirectives?"
+  end
+end
+
+
+ +
+

+ + .remove_directive(directives, directive_class) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+46
+47
+48
+
+
# File 'lib/graphql/schema/member/has_directives.rb', line 46
+
+def remove_directive(directives, directive_class)
+  directives && directives.reject! { |d| d.is_a?(directive_class) }
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #directive(dir_class, **options) ⇒ void + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This method returns an undefined value.

Create an instance of dir_class for self, using options.

+ +

It removes a previously-attached instance of dir_class, if there is one.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+25
+26
+
+
# File 'lib/graphql/schema/member/has_directives.rb', line 22
+
+def directive(dir_class, **options)
+  @own_directives ||= []
+  HasDirectives.add_directive(self, @own_directives, dir_class, options)
+  nil
+end
+
+
+ +
+

+ + #directivesObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/schema/member/has_directives.rb', line 36
+
+def directives
+  HasDirectives.get_directives(self, @own_directives, :directives)
+end
+
+
+ +
+

+ + #inherited(child_cls) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+12
+13
+14
+15
+
+
# File 'lib/graphql/schema/member/has_directives.rb', line 12
+
+def inherited(child_cls)
+  super
+  child_cls.own_directives = nil
+end
+
+
+ +
+

+ + #remove_directive(dir_class) ⇒ viod + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Remove an attached instance of dir_class, if there is one

+ + +
+
+
+

Parameters:

+ + +

Returns:

+
    + +
  • + + + (viod) + + + +
  • + +
+ +
+ + + + +
+
+
+
+31
+32
+33
+34
+
+
# File 'lib/graphql/schema/member/has_directives.rb', line 31
+
+def remove_directive(dir_class)
+  HasDirectives.remove_directive(@own_directives, dir_class)
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasFields.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasFields.html new file mode 100644 index 0000000000..a596c28fea --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasFields.html @@ -0,0 +1,777 @@ + + + + + + + Module: GraphQL::Schema::Member::HasFields + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasFields + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Interface::DefinitionMethods, GraphQL::Schema::Mutation, Object, Subscription
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_fields.rb
+
+ +
+ +

Overview

+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+

Shared code for Objects, Interfaces, Mutations, Subscriptions

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: InterfaceMethods, ObjectMethods + + + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
RUBY_KEYWORDS = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+

A list of Ruby keywords.

+ + +
+
+
+ + +
+
+
[:class, :module, :def, :undef, :begin, :rescue, :ensure, :end, :if, :unless, :then, :elsif, :else, :case, :when, :while, :until, :for, :break, :next, :redo, :retry, :in, :do, :return, :yield, :super, :self, :nil, :true, :false, :and, :or, :not, :alias, :defined?, :BEGIN, :END, :__LINE__, :__FILE__]
+ +
GRAPHQL_RUBY_KEYWORDS = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+

A list of GraphQL-Ruby keywords.

+ + +
+
+
+ + +
+
+
[:context, :object, :raw_value]
+ +
CONFLICT_FIELD_NAMES = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+

A list of field names that we should advise users to pick a different +resolve method name.

+ + +
+
+
+ + +
+
+
Set.new(GRAPHQL_RUBY_KEYWORDS + RUBY_KEYWORDS + Object.instance_methods)
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #add_field(field_defn, method_conflict_warning: field_defn.method_conflict_warning?) ⇒ void + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This method returns an undefined value.

Register this field with the class, overriding a previous one if needed.

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+
+
# File 'lib/graphql/schema/member/has_fields.rb', line 36
+
+def add_field(field_defn, method_conflict_warning: field_defn.method_conflict_warning?)
+  # Check that `field_defn.original_name` equals `resolver_method` and `method_sym` --
+  # that shows that no override value was given manually.
+  if method_conflict_warning &&
+      CONFLICT_FIELD_NAMES.include?(field_defn.resolver_method) &&
+      field_defn.original_name == field_defn.resolver_method &&
+      field_defn.original_name == field_defn.method_sym &&
+      field_defn.hash_key == NOT_CONFIGURED &&
+      field_defn.dig_keys.nil?
+    warn(conflict_field_name_warning(field_defn))
+  end
+  prev_defn = own_fields[field_defn.name]
+
+  case prev_defn
+  when nil
+    own_fields[field_defn.name] = field_defn
+  when Array
+    prev_defn << field_defn
+  when GraphQL::Schema::Field
+    own_fields[field_defn.name] = [prev_defn, field_defn]
+  else
+    raise "Invariant: unexpected previous field definition for #{field_defn.name.inspect}: #{prev_defn.inspect}"
+  end
+
+  nil
+end
+
+
+ +
+

+ + #all_field_definitionsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+
+
# File 'lib/graphql/schema/member/has_fields.rb', line 87
+
+def all_field_definitions
+  all_fields = {}
+  ancestors.reverse_each do |ancestor|
+    if ancestor.respond_to?(:own_fields)
+      all_fields.merge!(ancestor.own_fields)
+    end
+  end
+  all_fields = all_fields.values
+  all_fields.flatten!
+  all_fields
+end
+
+
+ +
+

+ + #field(*args, **kwargs, &block) ⇒ GraphQL::Schema::Field + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Add a field to this object or interface with the given definition

+ + +
+
+
+ +

Returns:

+ + +

See Also:

+
    + +
  • for method signature
  • + +
+ +
+ + + + +
+
+
+
+11
+12
+13
+14
+15
+
+
# File 'lib/graphql/schema/member/has_fields.rb', line 11
+
+def field(*args, **kwargs, &block)
+  field_defn = field_class.from_options(*args, owner: self, **kwargs, &block)
+  add_field(field_defn)
+  field_defn
+end
+
+
+ +
+

+ + #field_class(new_field_class = nil) ⇒ Class + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns The class to initialize when adding fields to this kind of schema member.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    The class to initialize when adding fields to this kind of schema member

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
+
# File 'lib/graphql/schema/member/has_fields.rb', line 64
+
+def field_class(new_field_class = nil)
+  if new_field_class
+    @field_class = new_field_class
+  elsif defined?(@field_class) && @field_class
+    @field_class
+  else
+    find_inherited_value(:field_class, GraphQL::Schema::Field)
+  end
+end
+
+
+ +
+

+ + #global_id_field(field_name, **kwargs) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+74
+75
+76
+77
+78
+79
+80
+
+
# File 'lib/graphql/schema/member/has_fields.rb', line 74
+
+def global_id_field(field_name, **kwargs)
+  type = self
+  field field_name, "ID", **kwargs, null: false
+  define_method(field_name) do
+    context.schema.id_from_object(object, type, context)
+  end
+end
+
+
+ +
+

+ + #own_fieldsHash<String => GraphQL::Schema::Field, Array<GraphQL::Schema::Field>> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Fields defined on this class specifically, not parent classes.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+83
+84
+85
+
+
# File 'lib/graphql/schema/member/has_fields.rb', line 83
+
+def own_fields
+  @own_fields ||= {}
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasFields/InterfaceMethods.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasFields/InterfaceMethods.html new file mode 100644 index 0000000000..9fb339a355 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasFields/InterfaceMethods.html @@ -0,0 +1,331 @@ + + + + + + + Module: GraphQL::Schema::Member::HasFields::InterfaceMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasFields::InterfaceMethods + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/member/has_fields.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #fields(context = GraphQL::Query::NullContext.instance) ⇒ Hash<String => GraphQL::Schema::Field> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Fields on this object, keyed by name, including inherited fields.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<String => GraphQL::Schema::Field>) + + + + — +

    Fields on this object, keyed by name, including inherited fields

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+
+
# File 'lib/graphql/schema/member/has_fields.rb', line 113
+
+def fields(context = GraphQL::Query::NullContext.instance)
+  warden = Warden.from_context(context)
+  # Local overrides take precedence over inherited fields
+  visible_fields = {}
+  for ancestor in ancestors
+    if ancestor.respond_to?(:own_fields)
+      ancestor.own_fields.each do |field_name, fields_entry|
+        # Choose the most local definition that passes `.visible?` --
+        # stop checking for fields by name once one has been found.
+        if !visible_fields.key?(field_name) && (f = Warden.visible_entry?(:visible_field?, fields_entry, context, warden))
+          visible_fields[field_name] = f
+        end
+      end
+    end
+  end
+  visible_fields
+end
+
+
+ +
+

+ + #get_field(field_name, context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+
+
# File 'lib/graphql/schema/member/has_fields.rb', line 100
+
+def get_field(field_name, context = GraphQL::Query::NullContext.instance)
+  warden = Warden.from_context(context)
+  for ancestor in ancestors
+    if ancestor.respond_to?(:own_fields) &&
+        (f_entry = ancestor.own_fields[field_name]) &&
+        (f = Warden.visible_entry?(:visible_field?, f_entry, context, warden))
+      return f
+    end
+  end
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasFields/ObjectMethods.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasFields/ObjectMethods.html new file mode 100644 index 0000000000..8fd4d0d008 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasFields/ObjectMethods.html @@ -0,0 +1,343 @@ + + + + + + + Module: GraphQL::Schema::Member::HasFields::ObjectMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasFields::ObjectMethods + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/member/has_fields.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #fields(context = GraphQL::Query::NullContext.instance) ⇒ Hash<String => GraphQL::Schema::Field> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Fields on this object, keyed by name, including inherited fields.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<String => GraphQL::Schema::Field>) + + + + — +

    Fields on this object, keyed by name, including inherited fields

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+
+
# File 'lib/graphql/schema/member/has_fields.rb', line 151
+
+def fields(context = GraphQL::Query::NullContext.instance)
+  # Objects need to check that the interface implementation is visible, too
+  warden = Warden.from_context(context)
+  # Local overrides take precedence over inherited fields
+  visible_fields = {}
+  for ancestor in ancestors
+    if ancestor.respond_to?(:own_fields) && visible_interface_implementation?(ancestor, context, warden)
+      ancestor.own_fields.each do |field_name, fields_entry|
+        # Choose the most local definition that passes `.visible?` --
+        # stop checking for fields by name once one has been found.
+        if !visible_fields.key?(field_name) && (f = Warden.visible_entry?(:visible_field?, fields_entry, context, warden))
+          visible_fields[field_name] = f
+        end
+      end
+    end
+  end
+  visible_fields
+end
+
+
+ +
+

+ + #get_field(field_name, context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+
+
# File 'lib/graphql/schema/member/has_fields.rb', line 133
+
+def get_field(field_name, context = GraphQL::Query::NullContext.instance)
+  # Objects need to check that the interface implementation is visible, too
+  warden = Warden.from_context(context)
+  ancs = ancestors
+  i = 0
+  while (ancestor = ancs[i])
+    if ancestor.respond_to?(:own_fields) &&
+        visible_interface_implementation?(ancestor, context, warden) &&
+        (f_entry = ancestor.own_fields[field_name]) &&
+        (f = Warden.visible_entry?(:visible_field?, f_entry, context, warden))
+      return f
+    end
+    i += 1
+  end
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces.html new file mode 100644 index 0000000000..01a6594872 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces.html @@ -0,0 +1,547 @@ + + + + + + + Module: GraphQL::Schema::Member::HasInterfaces + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasInterfaces + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Interface::DefinitionMethods, Object
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_interfaces.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: ClassConfigured + + + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #implements(*new_interfaces, **options) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
+
# File 'lib/graphql/schema/member/has_interfaces.rb', line 7
+
+def implements(*new_interfaces, **options)
+  new_memberships = []
+  new_interfaces.each do |int|
+    if int.is_a?(Module)
+      unless int.include?(GraphQL::Schema::Interface)
+        raise "#{int} cannot be implemented since it's not a GraphQL Interface. Use `include` for plain Ruby modules."
+      end
+
+      new_memberships << int.type_membership_class.new(int, self, **options)
+
+      # Include the methods here,
+      # `.fields` will use the inheritance chain
+      # to find inherited fields
+      include(int)
+
+      # If this interface has interfaces of its own, add those, too
+      int.interfaces.each do |next_interface|
+        implements(next_interface)
+      end
+    elsif int.is_a?(String) || int.is_a?(GraphQL::Schema::LateBoundType)
+      if options.any?
+        raise ArgumentError, "`implements(...)` doesn't support options with late-loaded types yet. Remove #{options} and open an issue to request this feature."
+      end
+      new_memberships << int
+    else
+      raise ArgumentError, "Unexpected interface definition (expected module): #{int} (#{int.class})"
+    end
+  end
+
+  # Remove any String or late-bound interfaces which are being replaced
+  own_interface_type_memberships.reject! { |old_i_m|
+    if !(old_i_m.respond_to?(:abstract_type) && old_i_m.abstract_type.is_a?(Module))
+      old_int_type = old_i_m.respond_to?(:abstract_type) ? old_i_m.abstract_type : old_i_m
+      old_name = Schema::Member::BuildType.to_type_name(old_int_type)
+
+      new_memberships.any? { |new_i_m|
+        new_int_type = new_i_m.respond_to?(:abstract_type) ? new_i_m.abstract_type : new_i_m
+        new_name = Schema::Member::BuildType.to_type_name(new_int_type)
+
+        new_name == old_name
+      }
+    end
+  }
+  own_interface_type_memberships.concat(new_memberships)
+end
+
+
+ +
+

+ + #interface_type_membershipsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/graphql/schema/member/has_interfaces.rb', line 57
+
+def interface_type_memberships
+  own_interface_type_memberships
+end
+
+
+ +
+

+ + #interfaces(context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

param context [Query::Context] If omitted, skip filtering.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+
+
# File 'lib/graphql/schema/member/has_interfaces.rb', line 102
+
+def interfaces(context = GraphQL::Query::NullContext.instance)
+  warden = Warden.from_context(context)
+  visible_interfaces = nil
+  own_interface_type_memberships.each do |type_membership|
+    case type_membership
+    when Schema::TypeMembership
+      if warden.visible_type_membership?(type_membership, context)
+        visible_interfaces ||= []
+        visible_interfaces << type_membership.abstract_type
+      end
+    when String, Schema::LateBoundType
+      # During initialization, `type_memberships` can hold late-bound types
+      visible_interfaces ||= []
+      visible_interfaces << type_membership
+    else
+      raise "Invariant: Unexpected type_membership #{type_membership.class}: #{type_membership.inspect}"
+    end
+  end
+  if visible_interfaces
+    visible_interfaces.uniq!
+    visible_interfaces
+  else
+    EmptyObjects::EMPTY_ARRAY
+  end
+end
+
+
+ +
+

+ + #own_interface_type_membershipsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+53
+54
+55
+
+
# File 'lib/graphql/schema/member/has_interfaces.rb', line 53
+
+def own_interface_type_memberships
+  @own_interface_type_memberships ||= []
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces/ClassConfigured.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces/ClassConfigured.html new file mode 100644 index 0000000000..08b51ada41 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces/ClassConfigured.html @@ -0,0 +1,219 @@ + + + + + + + Module: GraphQL::Schema::Member::HasInterfaces::ClassConfigured + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasInterfaces::ClassConfigured + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/member/has_interfaces.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: InheritedInterfaces + + + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ +
    + +
  • + + + #inherited(child_class) ⇒ Object + + + + + + + + + + + private + + +

    This combination of extended -> inherited -> extended means that the base class (Schema::Object) won’t have the superclass-related code in InheritedInterfaces, but child classes of Schema::Object will have it.

    +
    + +
  • + + +
+ + + + +
+

Instance Method Details

+ + +
+

+ + #inherited(child_class) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This combination of extended -> inherited -> extended +means that the base class (Schema::Object) won’t +have the superclass-related code in InheritedInterfaces, +but child classes of Schema::Object will have it. +That way, we don’t need a superclass.respond_to?(...) check.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+67
+68
+69
+70
+
+
# File 'lib/graphql/schema/member/has_interfaces.rb', line 67
+
+def inherited(child_class)
+  super
+  child_class.extend(InheritedInterfaces)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces/ClassConfigured/InheritedInterfaces.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces/ClassConfigured/InheritedInterfaces.html new file mode 100644 index 0000000000..237fe1e3ea --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasInterfaces/ClassConfigured/InheritedInterfaces.html @@ -0,0 +1,306 @@ + + + + + + + Module: GraphQL::Schema::Member::HasInterfaces::ClassConfigured::InheritedInterfaces + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasInterfaces::ClassConfigured::InheritedInterfaces + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/member/has_interfaces.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #interface_type_membershipsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+89
+90
+91
+92
+93
+94
+95
+96
+97
+
+
# File 'lib/graphql/schema/member/has_interfaces.rb', line 89
+
+def interface_type_memberships
+  own_tms = super
+  inherited_tms = superclass.interface_type_memberships
+  if inherited_tms.size > 0
+    own_tms + inherited_tms
+  else
+    own_tms
+  end
+end
+
+
+ +
+

+ + #interfaces(context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+
+
# File 'lib/graphql/schema/member/has_interfaces.rb', line 73
+
+def interfaces(context = GraphQL::Query::NullContext.instance)
+  visible_interfaces = super
+  inherited_interfaces = superclass.interfaces(context)
+  if visible_interfaces.any?
+    if inherited_interfaces.any?
+      visible_interfaces.concat(inherited_interfaces)
+      visible_interfaces.uniq!
+    end
+    visible_interfaces
+  elsif inherited_interfaces.any?
+    inherited_interfaces
+  else
+    EmptyObjects::EMPTY_ARRAY
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasPath.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasPath.html new file mode 100644 index 0000000000..3b8dac335b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasPath.html @@ -0,0 +1,247 @@ + + + + + + + Module: GraphQL::Schema::Member::HasPath + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasPath + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Argument, EnumValue, Field, Interface::DefinitionMethods, GraphQL::Schema::Member, Resolver, Resolver
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_path.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ +
    + +
  • + + + #path ⇒ String + + + + + + + + + + + private + + +

    A description of this member’s place in the GraphQL schema.

    +
    + +
  • + + +
+ + + + +
+

Instance Method Details

+ + +
+

+ + #pathString + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns A description of this member’s place in the GraphQL schema.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    A description of this member’s place in the GraphQL schema

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/schema/member/has_path.rb', line 8
+
+def path
+  path_str = if self.respond_to?(:graphql_name)
+    self.graphql_name
+  elsif self.class.respond_to?(:graphql_name)
+    # Instances of resolvers
+    self.class.graphql_name
+  end
+
+  if self.respond_to?(:owner) && owner.respond_to?(:path)
+    path_str = "#{owner.path}.#{path_str}"
+  end
+
+  path_str
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasUnresolvedTypeError.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasUnresolvedTypeError.html new file mode 100644 index 0000000000..6f442c774c --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasUnresolvedTypeError.html @@ -0,0 +1,124 @@ + + + + + + + Module: GraphQL::Schema::Member::HasUnresolvedTypeError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasUnresolvedTypeError + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Interface::DefinitionMethods, Union
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_unresolved_type_error.rb
+
+ +
+ +

Overview

+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+

Set up a type-specific error to make debugging & bug tracker integration better

+ + +
+
+
+ + +
+ + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasValidators.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasValidators.html new file mode 100644 index 0000000000..fb4ee8f72a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasValidators.html @@ -0,0 +1,337 @@ + + + + + + + Module: GraphQL::Schema::Member::HasValidators + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasValidators + + + Private +

+
+ + + + + + +
+
Includes:
+
EmptyObjects
+
+ + + + +
+
Included in:
+
Argument, Field, InputObject, Resolver
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/has_validators.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: ClassConfigured + + + + +

+ + + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + +
+

Instance Method Details

+ + +
+

+ + #validates(validation_config) ⇒ void + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This method returns an undefined value.

Build Validators based on the given configuration +and use them for this schema member

+ + +
+
+
+

Parameters:

+
    + +
  • + + validation_config + + + (Hash{Symbol => Hash}) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+12
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/schema/member/has_validators.rb', line 12
+
+def validates(validation_config)
+  new_validators = GraphQL::Schema::Validator.from_config(self, validation_config)
+  @own_validators ||= []
+  @own_validators.concat(new_validators)
+  nil
+end
+
+
+ +
+

+ + #validatorsArray<GraphQL::Schema::Validator> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/schema/member/has_validators.rb', line 20
+
+def validators
+  @own_validators || EMPTY_ARRAY
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasValidators/ClassConfigured.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasValidators/ClassConfigured.html new file mode 100644 index 0000000000..3cc1b6a87b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasValidators/ClassConfigured.html @@ -0,0 +1,215 @@ + + + + + + + Module: GraphQL::Schema::Member::HasValidators::ClassConfigured + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasValidators::ClassConfigured + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/member/has_validators.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: ClassValidators + + + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #inherited(child_cls) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+28
+
+
# File 'lib/graphql/schema/member/has_validators.rb', line 25
+
+def inherited(child_cls)
+  super
+  child_cls.extend(ClassValidators)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/HasValidators/ClassConfigured/ClassValidators.html b/api-doc/2.1.6/GraphQL/Schema/Member/HasValidators/ClassConfigured/ClassValidators.html new file mode 100644 index 0000000000..fb2ffb3eba --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/HasValidators/ClassConfigured/ClassValidators.html @@ -0,0 +1,242 @@ + + + + + + + Module: GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators + + + Private +

+
+ + + + + + +
+
Includes:
+
EmptyObjects
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/member/has_validators.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + +
+

Instance Method Details

+ + +
+

+ + #validatorsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'lib/graphql/schema/member/has_validators.rb', line 33
+
+def validators
+  inherited_validators = superclass.validators
+  if inherited_validators.any?
+    if @own_validators.nil?
+      inherited_validators
+    else
+      inherited_validators + @own_validators
+    end
+  elsif @own_validators.nil?
+    EMPTY_ARRAY
+  else
+    @own_validators
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/RelayShortcuts.html b/api-doc/2.1.6/GraphQL/Schema/Member/RelayShortcuts.html new file mode 100644 index 0000000000..550196f758 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/RelayShortcuts.html @@ -0,0 +1,514 @@ + + + + + + + Module: GraphQL::Schema::Member::RelayShortcuts + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::RelayShortcuts + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Interface::DefinitionMethods, GraphQL::Schema::Member
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/relay_shortcuts.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #connection_typeObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'lib/graphql/schema/member/relay_shortcuts.rb', line 53
+
+def connection_type
+  
+  @connection_type ||= begin
+    conn_name = self.graphql_name + "Connection"
+    edge_type_class = self.edge_type
+    Class.new(connection_type_class) do
+      graphql_name(conn_name)
+      edge_type(edge_type_class)
+    end
+  end
+end
+
+
+ + + +
+

+ + #connection_type_class(new_connection_type_class = nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
+
# File 'lib/graphql/schema/member/relay_shortcuts.rb', line 24
+
+def connection_type_class(new_connection_type_class = nil)
+  if new_connection_type_class
+    
+    @connection_type_class = new_connection_type_class
+  else
+    # Don't call `ancestor.connection_type_class`
+    # because we don't want a fallback from any ancestors --
+    # only apply the fallback if _no_ ancestor has a configured value!
+    for ancestor in self.ancestors
+      if ancestor.respond_to?(:configured_connection_type_class, true) && (ctc = ancestor.configured_connection_type_class)
+        return ctc
+      end
+    end
+    Types::Relay::BaseConnection
+  end
+end
+
+
+ + + +
+

+ + #edge_typeObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
+
# File 'lib/graphql/schema/member/relay_shortcuts.rb', line 41
+
+def edge_type
+  
+  @edge_type ||= begin
+    edge_name = self.graphql_name + "Edge"
+    node_type_class = self
+    Class.new(edge_type_class) do
+      graphql_name(edge_name)
+      node_type(node_type_class)
+    end
+  end
+end
+
+
+ + + +
+

+ + #edge_type_class(new_edge_type_class = nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/schema/member/relay_shortcuts.rb', line 7
+
+def edge_type_class(new_edge_type_class = nil)
+  if new_edge_type_class
+    
+    @edge_type_class = new_edge_type_class
+  else
+    # Don't call `ancestor.edge_type_class`
+    # because we don't want a fallback from any ancestors --
+    # only apply the fallback if _no_ ancestor has a configured value!
+    for ancestor in self.ancestors
+      if ancestor.respond_to?(:configured_edge_type_class, true) && (etc = ancestor.configured_edge_type_class)
+        return etc
+      end
+    end
+    Types::Relay::BaseEdge
+  end
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/Scoped.html b/api-doc/2.1.6/GraphQL/Schema/Member/Scoped.html new file mode 100644 index 0000000000..e290dfd098 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/Scoped.html @@ -0,0 +1,414 @@ + + + + + + + Module: GraphQL::Schema::Member::Scoped + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::Scoped + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Interface::DefinitionMethods, GraphQL::Schema::Member
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/scoped.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #inherited(subclass) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+
+
# File 'lib/graphql/schema/member/scoped.rb', line 31
+
+def inherited(subclass)
+  super
+  subclass.class_eval do
+    @reauthorize_scoped_objects = nil
+  end
+end
+
+
+ +
+

+ + #reauthorize_scoped_objects(new_value = nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
+
# File 'lib/graphql/schema/member/scoped.rb', line 19
+
+def reauthorize_scoped_objects(new_value = nil)
+  if new_value.nil?
+    if @reauthorize_scoped_objects != nil
+      @reauthorize_scoped_objects
+    else
+      find_inherited_value(:reauthorize_scoped_objects, nil)
+    end
+  else
+    @reauthorize_scoped_objects = new_value
+  end
+end
+
+
+ +
+

+ + #scope_items(items, context) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This is called when a field has scope: true. +The field’s return type class receives this call.

+ +

By default, it’s a no-op. Override it to scope your objects.

+ + +
+
+
+

Parameters:

+
    + +
  • + + items + + + (Object) + + + + — +

    Some list-like object (eg, Array, ActiveRecord::Relation)

    +
    + +
  • + +
  • + + context + + + (GraphQL::Query::Context) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    Another list-like object, scoped to the current context

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/schema/member/scoped.rb', line 15
+
+def scope_items(items, context)
+  items
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/TypeSystemHelpers.html b/api-doc/2.1.6/GraphQL/Schema/Member/TypeSystemHelpers.html new file mode 100644 index 0000000000..bd3e51b729 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/TypeSystemHelpers.html @@ -0,0 +1,708 @@ + + + + + + + Module: GraphQL::Schema::Member::TypeSystemHelpers + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::TypeSystemHelpers + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Interface::DefinitionMethods, GraphQL::Schema::Member, Wrapper
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/type_system_helpers.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #initialize(*args, &block) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+
+
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 7
+
+def initialize(*args, &block)
+  super
+  @to_non_null_type ||= nil
+  @to_list_type ||= nil
+end
+
+
+ +
+

+ + #kindGraphQL::TypeKinds::TypeKind + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ +

Raises:

+ + +
+ + + + +
+
+
+
+39
+40
+41
+
+
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 39
+
+def kind
+  raise GraphQL::RequiredImplementationMissingError, "No `.kind` defined for #{self}"
+end
+
+
+ +
+

+ + #list?Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns true if this is a list type. A non-nullable list is considered a list.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    true if this is a list type. A non-nullable list is considered a list.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 30
+
+def list?
+  false
+end
+
+
+ +
+

+ + #non_null?Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns true if this is a non-nullable type. A nullable list of non-nullables is considered nullable.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    true if this is a non-nullable type. A nullable list of non-nullables is considered nullable.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 25
+
+def non_null?
+  false
+end
+
+
+ +
+

+ + #to_list_typeSchema::List + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Make a list-type representation of this type.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Schema::List) + + + + — +

    Make a list-type representation of this type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 20
+
+def to_list_type
+  @to_list_type ||= GraphQL::Schema::List.new(self)
+end
+
+
+ +
+

+ + #to_non_null_typeSchema::NonNull + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Make a non-null-type representation of this type.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Schema::NonNull) + + + + — +

    Make a non-null-type representation of this type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 15
+
+def to_non_null_type
+  @to_non_null_type ||= GraphQL::Schema::NonNull.new(self)
+end
+
+
+ +
+

+ + #to_type_signatureObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'lib/graphql/schema/member/type_system_helpers.rb', line 34
+
+def to_type_signature
+  graphql_name
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Member/ValidatesInput.html b/api-doc/2.1.6/GraphQL/Schema/Member/ValidatesInput.html new file mode 100644 index 0000000000..f355f2728e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Member/ValidatesInput.html @@ -0,0 +1,510 @@ + + + + + + + Module: GraphQL::Schema::Member::ValidatesInput + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Member::ValidatesInput + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Enum, InputObject, List, NonNull, Scalar
+
+ + + +
+
Defined in:
+
lib/graphql/schema/member/validates_input.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #coerce_isolated_input(v) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/graphql/schema/member/validates_input.rb', line 23
+
+def coerce_isolated_input(v)
+  coerce_input(v, GraphQL::Query::NullContext.instance)
+end
+
+
+ +
+

+ + #coerce_isolated_result(v) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/graphql/schema/member/validates_input.rb', line 27
+
+def coerce_isolated_result(v)
+  coerce_result(v, GraphQL::Query::NullContext.instance)
+end
+
+
+ +
+

+ + #valid_input?(val, ctx) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/schema/member/validates_input.rb', line 7
+
+def valid_input?(val, ctx)
+  validate_input(val, ctx).valid?
+end
+
+
+ +
+

+ + #valid_isolated_input?(v) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/schema/member/validates_input.rb', line 19
+
+def valid_isolated_input?(v)
+  valid_input?(v, GraphQL::Query::NullContext.instance)
+end
+
+
+ +
+

+ + #validate_input(val, ctx, max_errors: nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/schema/member/validates_input.rb', line 11
+
+def validate_input(val, ctx, max_errors: nil)
+  if val.nil?
+    Query::InputValidationResult::VALID
+  else
+    validate_non_null_input(val, ctx, max_errors: max_errors) || Query::InputValidationResult::VALID
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Mutation.html b/api-doc/2.1.6/GraphQL/Schema/Mutation.html new file mode 100644 index 0000000000..1825a04876 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Mutation.html @@ -0,0 +1,443 @@ + + + + + + + Class: GraphQL::Schema::Mutation + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Mutation + + + +

+
+ +
+
Inherits:
+
+ Resolver + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
GraphQL::Schema::Member::HasFields, Resolver::HasPayloadType
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/schema/mutation.rb
+
+ +
+ +

Overview

+
+

This base class accepts configuration for a mutation root field, +then it can be hooked up to your mutation root object type.

+ +

If you want to customize how this class generates types, in your base class, +override the various generate_* methods.

+ + +
+
+
+ +
+

Examples:

+ + +

Creating a comment

+

+ +
# Define the mutation:
+class Mutations::CreateComment < GraphQL::Schema::Mutation
+  argument :body, String, required: true
+  argument :post_id, ID, required: true
+
+  field :comment, Types::Comment, null: true
+  field :errors, [String], null: false
+
+  def resolve(body:, post_id:)
+    post = Post.find(post_id)
+    comment = post.comments.build(body: body, author: context[:current_user])
+    if comment.save
+      # Successful creation, return the created object with no errors
+      {
+        comment: comment,
+        errors: [],
+      }
+    else
+      # Failed save, return the errors to the client
+      {
+        comment: nil,
+        errors: comment.errors.full_messages
+      }
+    end
+  end
+end
+
+# Hook it up to your mutation:
+class Types::Mutation < GraphQL::Schema::Object
+  field :create_comment, mutation: Mutations::CreateComment
+end
+
+# Call it from GraphQL:
+result = MySchema.execute <<-GRAPHQL
+mutation {
+  createComment(postId: "1", body: "Nice Post!") {
+    errors
+    comment {
+      body
+      author {
+        login
+      }
+    }
+  }
+}
+GRAPHQL
+ +
+ + +

See Also:

+
    + +
  • for an extension of this class with some conventions built-in.
  • + +
+ +
+

Direct Known Subclasses

+

RelayClassicMutation

+
+ + + +

Constant Summary

+ +

Constants included + from GraphQL::Schema::Member::HasFields

+

GraphQL::Schema::Member::HasFields::CONFLICT_FIELD_NAMES, GraphQL::Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, GraphQL::Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Resolver::HasPayloadType

+

Resolver::HasPayloadType::NO_INTERFACES

+ + + +

Constants included + from GraphQL::Schema::Member::HasArguments

+

GraphQL::Schema::Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + +

Constants included + from GraphQL::Schema::Member::GraphQLTypeNames

+

GraphQL::Schema::Member::GraphQLTypeNames::Boolean, GraphQL::Schema::Member::GraphQLTypeNames::ID, GraphQL::Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Resolver

+

#context, #field, #object

+ + + +

Attributes included from GraphQL::Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from GraphQL::Schema::Member::HasFields

+

add_field, all_field_definitions, field, field_class, global_id_field, own_fields

+ + + + + + + + + +

Methods included from Resolver::HasPayloadType

+

field, field_class, object_class, payload_type, type

+ + + + + + + + + +

Methods inherited from Resolver

+

all_field_argument_definitions, any_field_arguments?, argument, #arguments, #authorized?, broadcastable, broadcastable?, complexity, #dataloader, default_page_size, extension, extensions, extras, field_arguments, get_field_argument, has_default_page_size?, has_max_page_size?, #initialize, max_page_size, null, #ready?, #resolve, resolve_method, #resolve_with_support, resolver_method, type, type_expr, #unauthorized_object

+ + + + + + + + + +

Methods included from GraphQL::Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from GraphQL::Schema::Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from GraphQL::Schema::Member::HasValidators

+

#validates, #validators

+ + + + + + + + + + + + + + + +

Methods included from GraphQL::Schema::Member::HasPath

+

#path

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Resolver

+ +
+ + +
+

Class Method Details

+ + +
+

+ + .visible?(context) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+66
+67
+68
+
+
# File 'lib/graphql/schema/mutation.rb', line 66
+
+def visible?(context)
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/NonNull.html b/api-doc/2.1.6/GraphQL/Schema/NonNull.html new file mode 100644 index 0000000000..2698138617 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/NonNull.html @@ -0,0 +1,850 @@ + + + + + + + Class: GraphQL::Schema::NonNull + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::NonNull + + + +

+
+ +
+
Inherits:
+
+ Wrapper + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Member::ValidatesInput
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/non_null.rb
+
+ +
+ +

Overview

+
+

Represents a non null type in the schema. +Wraps a Member when it is required.

+ + +
+
+
+ + +

See Also:

+
    + +
  • {Schema{Schema::Member{Schema::Member::TypeSystemHelpers{Schema::Member::TypeSystemHelpers#to_non_null_type}
  • + +
+ +
+ + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Wrapper

+

#of_type

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?

+ + + + + + + + + +

Methods inherited from Wrapper

+

#==, #initialize, #unwrap

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #to_list_type, #to_non_null_type

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Wrapper

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #coerce_input(value, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+49
+50
+51
+52
+53
+54
+55
+
+
# File 'lib/graphql/schema/non_null.rb', line 49
+
+def coerce_input(value, ctx)
+  # `.validate_input` above is used for variables, but this method is used for arguments
+  if value.nil?
+    raise GraphQL::ExecutionError, "`null` is not a valid input for `#{to_type_signature}`, please provide a value for this argument."
+  end
+  of_type.coerce_input(value, ctx)
+end
+
+
+ +
+

+ + #coerce_result(value, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/graphql/schema/non_null.rb', line 57
+
+def coerce_result(value, ctx)
+  of_type.coerce_result(value, ctx)
+end
+
+
+ +
+

+ + #descriptionObject + + + + + +

+
+

This is for implementing introspection

+ + +
+
+
+ + +
+ + + + +
+
+
+
+62
+63
+64
+
+
# File 'lib/graphql/schema/non_null.rb', line 62
+
+def description
+  nil
+end
+
+
+ +
+

+ + #graphql_nameObject + + + + + +

+
+

This is for introspection, where it’s expected the name will be null

+ + +
+
+
+ + +
+ + + + +
+
+
+
+45
+46
+47
+
+
# File 'lib/graphql/schema/non_null.rb', line 45
+
+def graphql_name
+  nil
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/schema/non_null.rb', line 30
+
+def inspect
+  "#<#{self.class.name} @of_type=#{@of_type.inspect}>"
+end
+
+
+ +
+

+ + #kindGraphQL::TypeKinds::NON_NULL + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::TypeKinds::NON_NULL) + + + +
  • + +
+ +
+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/schema/non_null.rb', line 12
+
+def kind
+  GraphQL::TypeKinds::NON_NULL
+end
+
+
+ +
+

+ + #list?Boolean + + + + + +

+
+

Returns True if this type wraps a list type.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if this type wraps a list type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/schema/non_null.rb', line 22
+
+def list?
+  @of_type.list?
+end
+
+
+ +
+

+ + #non_null?true + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (true) + + + +
  • + +
+ +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/schema/non_null.rb', line 17
+
+def non_null?
+  true
+end
+
+
+ +
+

+ + #to_type_signatureObject + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/schema/non_null.rb', line 26
+
+def to_type_signature
+  "#{@of_type.to_type_signature}!"
+end
+
+
+ +
+

+ + #validate_input(value, ctx, max_errors: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'lib/graphql/schema/non_null.rb', line 34
+
+def validate_input(value, ctx, max_errors: nil)
+  if value.nil?
+    result = GraphQL::Query::InputValidationResult.new
+    result.add_problem("Expected value to not be null")
+    result
+  else
+    of_type.validate_input(value, ctx, max_errors: max_errors)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/NullMask.html b/api-doc/2.1.6/GraphQL/Schema/NullMask.html new file mode 100644 index 0000000000..3714cb2605 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/NullMask.html @@ -0,0 +1,203 @@ + + + + + + + Module: GraphQL::Schema::NullMask + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::NullMask + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/null_mask.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .call(member, ctx) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/schema/null_mask.rb', line 6
+
+def self.call(member, ctx)
+  false
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Object.html b/api-doc/2.1.6/GraphQL/Schema/Object.html new file mode 100644 index 0000000000..b5780c24cf --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Object.html @@ -0,0 +1,1213 @@ + + + + + + + Class: GraphQL::Schema::Object + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Object + + + +

+
+ +
+
Inherits:
+
+ Member + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Member::HasFields, Member::HasInterfaces
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/schema/object.rb
+
+ +
+ + + + + +

Constant Summary

+ +

Constants included + from Member::HasFields

+

Member::HasFields::CONFLICT_FIELD_NAMES, Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Member::HasFields

+

add_field, all_field_definitions, field, field_class, global_id_field, own_fields

+ + + + + + + + + +

Methods included from Member::HasInterfaces

+

implements, interface_type_memberships, interfaces, own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(object, context) ⇒ Object + + + + + +

+
+

Returns a new instance of Object.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+104
+105
+106
+107
+
+
# File 'lib/graphql/schema/object.rb', line 104
+
+def initialize(object, context)
+  @object = object
+  @context = context
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #contextGraphQL::Query::Context (readonly) + + + + + +

+
+

Returns the context instance for this query.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/schema/object.rb', line 15
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #objectObject (readonly) + + + + + +

+
+

Returns the application object this type is wrapping.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the application object this type is wrapping

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/schema/object.rb', line 12
+
+def object
+  @object
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .authorized_new(object, context) ⇒ GraphQL::Schema::Object, GraphQL::Execution::Lazy + + + + + +

+
+

Make a new instance of this type if the auth check passes, +otherwise, raise an error.

+ +

Probably only the framework should call this method.

+ +

This might return a Execution::Lazy if the user-provided .authorized? +hook returns some lazy value (like a Promise).

+ +

The reason that the auth check is in this wrapper method instead of new is because +of how it might return a Promise. It would be weird if .new returned a promise; +It would be a headache to try to maintain Promise-y state inside a GraphQL::Schema::Object +instance. So, hopefully this wrapper method will do the job.

+ + +
+
+
+

Parameters:

+ + +

Returns:

+ +

Raises:

+ + +
+ + + + +
+
+
+
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+
+
# File 'lib/graphql/schema/object.rb', line 59
+
+def authorized_new(object, context)
+  maybe_lazy_auth_val = context.query.current_trace.authorized(query: context.query, type: self, object: object) do
+    begin
+      authorized?(object, context)
+    rescue GraphQL::UnauthorizedError => err
+      context.schema.unauthorized_object(err)
+    rescue StandardError => err
+      context.query.handle_or_reraise(err)
+    end
+  end
+
+  auth_val = if context.schema.lazy?(maybe_lazy_auth_val)
+    GraphQL::Execution::Lazy.new do
+      context.query.current_trace.authorized_lazy(query: context.query, type: self, object: object) do
+        context.schema.sync_lazy(maybe_lazy_auth_val)
+      end
+    end
+  else
+    maybe_lazy_auth_val
+  end
+
+  context.query.after_lazy(auth_val) do |is_authorized|
+    if is_authorized
+      self.new(object, context)
+    else
+      # It failed the authorization check, so go to the schema's authorized object hook
+      err = GraphQL::UnauthorizedError.new(object: object, type: self, context: context)
+      # If a new value was returned, wrap that instead of the original value
+      begin
+        new_obj = context.schema.unauthorized_object(err)
+        if new_obj
+          self.new(new_obj, context)
+        else
+          nil
+        end
+      end
+    end
+  end
+end
+
+
+ +
+

+ + .const_missing(name) ⇒ Object + + + + + +

+
+

Set up a type-specific invalid null error to use when this object’s non-null fields wrongly return nil. +It should help with debugging and bug tracker integrations.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+112
+113
+114
+115
+116
+117
+118
+119
+120
+
+
# File 'lib/graphql/schema/object.rb', line 112
+
+def const_missing(name)
+  if name == :InvalidNullError
+    custom_err_class = GraphQL::InvalidNullError.subclass_for(self)
+    const_set(:InvalidNullError, custom_err_class)
+    custom_err_class
+  else
+    super
+  end
+end
+
+
+ +
+

+ + .kindObject + + + + + +

+ + + + +
+
+
+
+122
+123
+124
+
+
# File 'lib/graphql/schema/object.rb', line 122
+
+def kind
+  GraphQL::TypeKinds::OBJECT
+end
+
+
+ +
+

+ + .scoped_new(object, context) ⇒ Object + + + + + +

+ + + + +
+
+
+
+99
+100
+101
+
+
# File 'lib/graphql/schema/object.rb', line 99
+
+def scoped_new(object, context)
+  self.new(object, context)
+end
+
+
+ +
+

+ + .wrap(object, context) ⇒ Object + + + + + +

+
+

This is called by the runtime to return an object to call methods on.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+38
+39
+40
+
+
# File 'lib/graphql/schema/object.rb', line 38
+
+def wrap(object, context)
+  authorized_new(object, context)
+end
+
+
+ +
+

+ + .wrap_scoped(object, context) ⇒ Object + + + + + +

+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/schema/object.rb', line 33
+
+def wrap_scoped(object, context)
+  scoped_new(object, context)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #dataloaderGraphQL::Dataloader + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/graphql/schema/object.rb', line 18
+
+def dataloader
+  context.dataloader
+end
+
+
+ +
+

+ + #raw_value(obj) ⇒ Object + + + + + +

+
+

Call this in a field method to return a value that should be returned to the client +without any further handling by GraphQL.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/schema/object.rb', line 24
+
+def raw_value(obj)
+  GraphQL::Execution::Interpreter::RawValue.new(obj)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Printer.html b/api-doc/2.1.6/GraphQL/Schema/Printer.html new file mode 100644 index 0000000000..4cd9b5491d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Printer.html @@ -0,0 +1,846 @@ + + + + + + + Class: GraphQL::Schema::Printer + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Printer + + + +

+
+ +
+
Inherits:
+
+ Language::Printer + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/printer.rb
+
+ +
+ +

Overview

+
+

Used to convert your GraphQL::Schema to a GraphQL schema string

+ + +
+
+
+ +
+

Examples:

+ + +

print your schema to standard output (via helper)

+

+ +
puts GraphQL::Schema::Printer.print_schema(MySchema)
+ + +

print your schema to standard output

+

+ +
puts GraphQL::Schema::Printer.new(MySchema).print_schema
+ + +

print a single type to standard output

+

+ +
class Types::Query < GraphQL::Schema::Object
+  description "The query root of this schema"
+
+  field :post, Types::Post, null: true
+end
+
+class Types::Post < GraphQL::Schema::Object
+  description "A blog post"
+
+  field :id, ID, null: false
+  field :title, String, null: false
+  field :body, String, null: false
+end
+
+class MySchema < GraphQL::Schema
+  query(Types::Query)
+end
+
+printer = GraphQL::Schema::Printer.new(MySchema)
+puts printer.print_type(Types::Post)
+ +
+ + +

Defined Under Namespace

+

+ + + + + Classes: IntrospectionPrinter + + +

+ + + +

Constant Summary

+ +

Constants inherited + from Language::Printer

+

Language::Printer::OMISSION

+ + +

Instance Attribute Summary collapse

+
    + +
  • + + + #schema ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute schema.

    +
    + +
  • + + +
  • + + + #warden ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute warden.

    +
    + +
  • + + +
+ + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Language::Printer

+

#print

+
+

Constructor Details

+ +
+

+ + #initialize(schema, context: nil, introspection: false) ⇒ Printer + + + + + +

+
+

Returns a new instance of Printer.

+ + +
+
+
+

Parameters:

+
    + +
  • + + schema + + + (GraphQL::Schema) + + + +
  • + +
  • + + context + + + (Hash) + + + (defaults to: nil) + + +
  • + +
  • + + introspection + + + (Boolean) + + + (defaults to: false) + + + — +

    Should include the introspection types in the string?

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
+
# File 'lib/graphql/schema/printer.rb', line 40
+
+def initialize(schema, context: nil, introspection: false)
+  @document_from_schema = GraphQL::Language::DocumentFromSchemaDefinition.new(
+    schema,
+    context: context,
+    include_introspection_types: introspection,
+  )
+
+  @document = @document_from_schema.document
+  @schema = schema
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #schemaObject (readonly) + + + + + +

+
+

Returns the value of attribute schema.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/graphql/schema/printer.rb', line 35
+
+def schema
+  @schema
+end
+
+
+ + + +
+

+ + #wardenObject (readonly) + + + + + +

+
+

Returns the value of attribute warden.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/graphql/schema/printer.rb', line 35
+
+def warden
+  @warden
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+
+
+

Return the GraphQL schema string for the introspection type system

+ + +
+
+
+ + +
+ + + + +
+
+
+
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
+
# File 'lib/graphql/schema/printer.rb', line 52
+
+def self.print_introspection_schema
+  query_root = Class.new(GraphQL::Schema::Object) do
+    graphql_name "Root"
+    field :throwaway_field, String
+    def self.visible?(ctx)
+      false
+    end
+  end
+  schema = Class.new(GraphQL::Schema) {
+    query(query_root)
+    def self.visible?(member, _ctx)
+      member.graphql_name != "Root"
+    end
+  }
+
+  introspection_schema_ast = GraphQL::Language::DocumentFromSchemaDefinition.new(
+    schema,
+    include_introspection_types: true,
+    include_built_in_directives: true,
+  ).document
+
+  introspection_schema_ast.to_query_string(printer: IntrospectionPrinter.new)
+end
+
+
+ +
+
+
+

Return a GraphQL schema string for the defined types in the schema

+ + +
+
+
+

Parameters:

+
    + +
  • + + schema + + + (GraphQL::Schema) + + + +
  • + +
  • + + context + + + (Hash) + + + +
  • + +
  • + + only + + + (<#call(member, ctx)>) + + + +
  • + +
  • + + except + + + (<#call(member, ctx)>) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+81
+82
+83
+84
+
+
# File 'lib/graphql/schema/printer.rb', line 81
+
+def self.print_schema(schema, **args)
+  printer = new(schema, **args)
+  printer.print_schema
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+
+
+

Return a GraphQL schema string for the defined types in the schema

+ + +
+
+
+ + +
+ + + + +
+
+
+
+87
+88
+89
+
+
# File 'lib/graphql/schema/printer.rb', line 87
+
+def print_schema
+  print(@document) + "\n"
+end
+
+
+ +
+ + + + + +
+
+
+
+91
+92
+93
+94
+
+
# File 'lib/graphql/schema/printer.rb', line 91
+
+def print_type(type)
+  node = @document_from_schema.build_type_definition_node(type)
+  print(node)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Printer/IntrospectionPrinter.html b/api-doc/2.1.6/GraphQL/Schema/Printer/IntrospectionPrinter.html new file mode 100644 index 0000000000..abacc3b336 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Printer/IntrospectionPrinter.html @@ -0,0 +1,210 @@ + + + + + + + Class: GraphQL::Schema::Printer::IntrospectionPrinter + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Printer::IntrospectionPrinter + + + +

+
+ +
+
Inherits:
+
+ Language::Printer + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/printer.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants inherited + from Language::Printer

+

Language::Printer::OMISSION

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Language::Printer

+

#print

+ + +
+

Instance Method Details

+ + +
+ + + + + +
+
+
+
+97
+98
+99
+
+
# File 'lib/graphql/schema/printer.rb', line 97
+
+def print_schema_definition(schema)
+  print_string("schema {\n  query: Root\n}")
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/RelayClassicMutation.html b/api-doc/2.1.6/GraphQL/Schema/RelayClassicMutation.html new file mode 100644 index 0000000000..d40f817e91 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/RelayClassicMutation.html @@ -0,0 +1,437 @@ + + + + + + + Class: GraphQL::Schema::RelayClassicMutation + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::RelayClassicMutation + + + +

+
+ +
+
Inherits:
+
+ Mutation + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
HasSingleInputArgument
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/relay_classic_mutation.rb
+
+ +
+ +

Overview

+
+

Mutations that extend this base class get some conventions added for free:

+ +
    +
  • An argument called clientMutationId is always added, but it’s not passed +to the resolve method. The value is re-inserted to the response. (It’s for +client libraries to manage optimistic updates.)
  • +
  • The returned object type always has a field called clientMutationId to support that.
  • +
  • The mutation accepts one argument called input, arguments defined in the mutation +class are added to that input object, which is generated by the mutation.
  • +
+ +

These conventions were first specified by Relay Classic, but they come in handy:

+ +
    +
  • clientMutationId supports optimistic updates and cache rollbacks on the client
  • +
  • using a single input: argument makes it easy to post whole JSON objects to the mutation +using one GraphQL variable ($input) instead of making a separate variable for each argument.
  • +
+ + +
+
+
+ + +

See Also:

+
    + +
  • for an example, it's basically the same.
  • + +
+ +
+ + +

Constant Summary

+ +

Constants included + from Member::HasFields

+

Member::HasFields::CONFLICT_FIELD_NAMES, Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from GraphQL::Schema::Resolver::HasPayloadType

+

GraphQL::Schema::Resolver::HasPayloadType::NO_INTERFACES

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Resolver

+

#context, #field, #object

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + + + +

Methods inherited from Mutation

+

visible?

+ + + + + + + + + +

Methods included from Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from GraphQL::Schema::Resolver::HasPayloadType

+

#field, #field_class, #object_class, #payload_type, #type

+ + + + + + + + + +

Methods inherited from Resolver

+

all_field_argument_definitions, any_field_arguments?, argument, #arguments, #authorized?, broadcastable, broadcastable?, complexity, #dataloader, default_page_size, extension, extensions, extras, field_arguments, get_field_argument, has_default_page_size?, has_max_page_size?, #initialize, max_page_size, null, #ready?, #resolve, resolve_method, resolver_method, type, type_expr, #unauthorized_object

+ + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasValidators

+

#validates, #validators

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Resolver

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #resolve_with_support(**inputs) ⇒ Object + + + + + +

+
+

Override GraphQL::Schema::Resolver#resolve_with_support to +delete client_mutation_id from the kwargs.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+
+
# File 'lib/graphql/schema/relay_classic_mutation.rb', line 35
+
+def resolve_with_support(**inputs)
+  input = inputs[:input].to_kwargs
+
+  if input
+    # This is handled by Relay::Mutation::Resolve, a bit hacky, but here we are.
+    input_kwargs = input.to_h
+    client_mutation_id = input_kwargs.delete(:client_mutation_id)
+    inputs[:input] = input_kwargs
+  end
+
+  return_value = super(**inputs)
+
+  context.query.after_lazy(return_value) do |return_hash|
+    # It might be an error
+    if return_hash.is_a?(Hash)
+      return_hash[:client_mutation_id] = client_mutation_id
+    end
+    return_hash
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/ResolveTypeWithType.html b/api-doc/2.1.6/GraphQL/Schema/ResolveTypeWithType.html new file mode 100644 index 0000000000..0387579730 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/ResolveTypeWithType.html @@ -0,0 +1,225 @@ + + + + + + + Module: GraphQL::Schema::ResolveTypeWithType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::ResolveTypeWithType + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema.rb
+
+ +
+ +

Overview

+
+

rubocop:disable Lint/DuplicateMethods

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #resolve_type(type, obj, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+
+
# File 'lib/graphql/schema.rb', line 908
+
+def resolve_type(type, obj, ctx)
+  maybe_lazy_resolve_type_result = if type.is_a?(Module) && type.respond_to?(:resolve_type)
+    type.resolve_type(obj, ctx)
+  else
+    super
+  end
+
+  after_lazy(maybe_lazy_resolve_type_result) do |resolve_type_result|
+    if resolve_type_result.is_a?(Array) && resolve_type_result.size == 2
+      resolved_type = resolve_type_result[0]
+      resolved_value = resolve_type_result[1]
+    else
+      resolved_type = resolve_type_result
+      resolved_value = obj
+    end
+
+    if resolved_type.nil? || (resolved_type.is_a?(Module) && resolved_type.respond_to?(:kind))
+      [resolved_type, resolved_value]
+    else
+      raise ".resolve_type should return a type definition, but got #{resolved_type.inspect} (#{resolved_type.class}) from `resolve_type(#{type}, #{obj}, #{ctx})`"
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Resolver.html b/api-doc/2.1.6/GraphQL/Schema/Resolver.html new file mode 100644 index 0000000000..21becc1cae --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Resolver.html @@ -0,0 +1,3079 @@ + + + + + + + Class: GraphQL::Schema::Resolver + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Resolver + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Member::BaseDSLMethods, Member::HasArguments, Member::HasPath, Member::HasValidators
+
+ + + +
+
Includes:
+
Member::GraphQLTypeNames, Member::HasPath
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/resolver.rb,
+ lib/graphql/schema/resolver/has_payload_type.rb
+
+
+ +
+ +

Overview

+
+

A class-based container for field configuration and resolution logic. It supports:

+ +
    +
  • Arguments, via .argument(...) helper, which will be applied to the field.
  • +
  • Return type, via .type(..., null: ...), which will be applied to the field.
  • +
  • Description, via .description(...), which will be applied to the field
  • +
  • Resolution, via #resolve(**args) method, which will be called to resolve the field.
  • +
  • #object and #context accessors for use during #resolve.
  • +
+ +

Resolvers can be attached with the resolver: option in a field(...) call.

+ +

A resolver’s configuration may be overridden with other keywords in the field(...) call.

+ + +
+
+
+ + +

See Also:

+
    + +
  • for a concrete subclass of `Resolver`.
  • + +
  • `Resolver` is a replacement for `GraphQL::Function`
  • + +
+ +
+

Direct Known Subclasses

+

Mutation, Subscription

+
+

Defined Under Namespace

+

+ + + Modules: HasPayloadType + + + + +

+ + + +

Constant Summary

+ +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + +

Instance Attribute Summary collapse

+ + + + + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

default_relay, description, introspection, introspection?, mutation, name, visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::HasArguments

+

add_argument, all_argument_definitions, any_arguments?, argument, argument_class, arguments_statically_coercible?, coerce_arguments, own_arguments, remove_argument, validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasValidators

+

validates, validators

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

path

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(object:, context:, field:) ⇒ Resolver + + + + + +

+
+

Returns a new instance of Resolver.

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'lib/graphql/schema/resolver.rb', line 32
+
+def initialize(object:, context:, field:)
+  @object = object
+  @context = context
+  @field = field
+  # Since this hash is constantly rebuilt, cache it for this call
+  @arguments_by_keyword = {}
+  self.class.arguments(context).each do |name, arg|
+    @arguments_by_keyword[arg.keyword] = arg
+  end
+  @prepared_arguments = nil
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #contextGraphQL::Query::Context (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'lib/graphql/schema/resolver.rb', line 48
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #fieldGraphQL::Schema::Field (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+56
+57
+58
+
+
# File 'lib/graphql/schema/resolver.rb', line 56
+
+def field
+  @field
+end
+
+
+ + + +
+

+ + #objectObject (readonly) + + + + + +

+
+

Returns The application object this field is being resolved on.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The application object this field is being resolved on

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+45
+46
+47
+
+
# File 'lib/graphql/schema/resolver.rb', line 45
+
+def object
+  @object
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .all_field_argument_definitionsObject + + + + + +

+ + + + +
+
+
+
+225
+226
+227
+
+
# File 'lib/graphql/schema/resolver.rb', line 225
+
+def all_field_argument_definitions
+  all_argument_definitions
+end
+
+
+ +
+

+ + .any_field_arguments?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+217
+218
+219
+
+
# File 'lib/graphql/schema/resolver.rb', line 217
+
+def any_field_arguments?
+  any_arguments?
+end
+
+
+ +
+

+ + .argument(*args, **kwargs, &block) ⇒ Object + + + + + +

+
+

Add an argument to this field’s signature, but +also add some preparation hook methods which will be used for this argument

+ + +
+
+
+ + +

See Also:

+
    + +
  • for the signature
  • + +
+ +
+ + + + +
+
+
+
+366
+367
+368
+369
+370
+
+
# File 'lib/graphql/schema/resolver.rb', line 366
+
+def argument(*args, **kwargs, &block)
+  # Use `from_resolver: true` to short-circuit the InputObject's own `loads:` implementation
+  # so that we can support `#load_{x}` methods below.
+  super(*args, from_resolver: true, **kwargs)
+end
+
+
+ +
+

+ + .broadcastable(new_broadcastable) ⇒ Object + + + + + +

+ + + + +
+
+
+
+303
+304
+305
+
+
# File 'lib/graphql/schema/resolver.rb', line 303
+
+def broadcastable(new_broadcastable)
+  @broadcastable = new_broadcastable
+end
+
+
+ +
+

+ + .broadcastable?Boolean? + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean, nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+308
+309
+310
+311
+312
+313
+314
+
+
# File 'lib/graphql/schema/resolver.rb', line 308
+
+def broadcastable?
+  if defined?(@broadcastable)
+    @broadcastable
+  else
+    (superclass.respond_to?(:broadcastable?) ? superclass.broadcastable? : nil)
+  end
+end
+
+
+ +
+

+ + .complexity(new_complexity = nil) ⇒ Integer, Proc + + + + + +

+
+

Specifies the complexity of the field. Defaults to 1

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer, Proc) + + + +
  • + +
+ +
+ + + + +
+
+
+
+296
+297
+298
+299
+300
+301
+
+
# File 'lib/graphql/schema/resolver.rb', line 296
+
+def complexity(new_complexity = nil)
+  if new_complexity
+    @complexity = new_complexity
+  end
+  @complexity || (superclass.respond_to?(:complexity) ? superclass.complexity : 1)
+end
+
+
+ +
+

+ + .default_page_size(new_default_page_size = NOT_CONFIGURED) ⇒ Integer? + + + + + +

+
+

Get or set the default_page_size: which will be configured for fields using this resolver +(nil means “unlimited default page size”.)

+ + +
+
+
+

Parameters:

+
    + +
  • + + default_page_size + + + (Integer, nil) + + + + — +

    Set a new value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Integer, nil) + + + + — +

    The default_page_size assigned to fields that use this resolver

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+
+
# File 'lib/graphql/schema/resolver.rb', line 341
+
+def default_page_size(new_default_page_size = NOT_CONFIGURED)
+  if new_default_page_size != NOT_CONFIGURED
+    @default_page_size = new_default_page_size
+  elsif defined?(@default_page_size)
+    @default_page_size
+  elsif superclass.respond_to?(:default_page_size)
+    superclass.default_page_size
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + .extension(extension, **options) ⇒ Object + + + + + +

+
+

Registers new extension

+ + +
+
+
+

Parameters:

+
    + +
  • + + extension + + + (Class) + + + + — +

    Extension class

    +
    + +
  • + +
  • + + options + + + (Hash) + + + + — +

    Optional extension options

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+375
+376
+377
+378
+
+
# File 'lib/graphql/schema/resolver.rb', line 375
+
+def extension(extension, **options)
+  @own_extensions ||= []
+  @own_extensions << {extension => options}
+end
+
+
+ +
+

+ + .extensionsObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+
+
# File 'lib/graphql/schema/resolver.rb', line 381
+
+def extensions
+  own_exts = @own_extensions
+  # Jump through some hoops to avoid creating arrays when we don't actually need them
+  if superclass.respond_to?(:extensions)
+    s_exts = superclass.extensions
+    if own_exts
+      if s_exts.any?
+        own_exts + s_exts
+      else
+        own_exts
+      end
+    else
+      s_exts
+    end
+  else
+    own_exts || EMPTY_ARRAY
+  end
+end
+
+
+ +
+

+ + .extras(new_extras = nil) ⇒ Object + + + + + +

+
+

Additional info injected into #resolve

+ + +
+
+
+ + +

See Also:

+
    + +
  • {GraphQL{GraphQL::Schema{GraphQL::Schema::Field{GraphQL::Schema::Field#extras}
  • + +
+ +
+ + + + +
+
+
+
+240
+241
+242
+243
+244
+245
+246
+
+
# File 'lib/graphql/schema/resolver.rb', line 240
+
+def extras(new_extras = nil)
+  if new_extras
+    @own_extras = new_extras
+  end
+  own_extras = @own_extras || []
+  own_extras + (superclass.respond_to?(:extras) ? superclass.extras : [])
+end
+
+
+ +
+

+ + .field_arguments(context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+ + + + +
+
+
+
+213
+214
+215
+
+
# File 'lib/graphql/schema/resolver.rb', line 213
+
+def field_arguments(context = GraphQL::Query::NullContext.instance)
+  arguments(context)
+end
+
+
+ +
+

+ + .get_field_argument(name, context = GraphQL::Query::NullContext.instance) ⇒ Object + + + + + +

+ + + + +
+
+
+
+221
+222
+223
+
+
# File 'lib/graphql/schema/resolver.rb', line 221
+
+def get_field_argument(name, context = GraphQL::Query::NullContext.instance)
+  get_argument(name, context)
+end
+
+
+ +
+

+ + .has_default_page_size?Boolean + + + + + +

+
+

Returns true if this resolver or a superclass has an assigned default_page_size.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    true if this resolver or a superclass has an assigned default_page_size

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+354
+355
+356
+
+
# File 'lib/graphql/schema/resolver.rb', line 354
+
+def has_default_page_size?
+  (!!defined?(@default_page_size)) || (superclass.respond_to?(:has_default_page_size?) && superclass.has_default_page_size?)
+end
+
+
+ +
+

+ + .has_max_page_size?Boolean + + + + + +

+
+

Returns true if this resolver or a superclass has an assigned max_page_size.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    true if this resolver or a superclass has an assigned max_page_size

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+333
+334
+335
+
+
# File 'lib/graphql/schema/resolver.rb', line 333
+
+def has_max_page_size?
+  (!!defined?(@max_page_size)) || (superclass.respond_to?(:has_max_page_size?) && superclass.has_max_page_size?)
+end
+
+
+ +
+

+ + .max_page_size(new_max_page_size = NOT_CONFIGURED) ⇒ Integer? + + + + + +

+
+

Get or set the max_page_size: which will be configured for fields using this resolver +(nil means “unlimited max page size”.)

+ + +
+
+
+

Parameters:

+
    + +
  • + + max_page_size + + + (Integer, nil) + + + + — +

    Set a new value

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Integer, nil) + + + + — +

    The max_page_size assigned to fields that use this resolver

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+
+
# File 'lib/graphql/schema/resolver.rb', line 320
+
+def max_page_size(new_max_page_size = NOT_CONFIGURED)
+  if new_max_page_size != NOT_CONFIGURED
+    @max_page_size = new_max_page_size
+  elsif defined?(@max_page_size)
+    @max_page_size
+  elsif superclass.respond_to?(:max_page_size)
+    superclass.max_page_size
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + .null(allow_null = nil) ⇒ Object + + + + + +

+
+

If true (default), then the return type for this resolver will be nullable. +If false, then the return type is non-null.

+ + +
+
+
+

Parameters:

+
    + +
  • + + allow_null + + + (Boolean) + + + (defaults to: nil) + + + — +

    Whether or not the response can be null

    +
    + +
  • + +
+ + +

See Also:

+
    + +
  • which sets the return type of this field and accepts a `null:` option
  • + +
+ +
+ + + + +
+
+
+
+253
+254
+255
+256
+257
+258
+259
+
+
# File 'lib/graphql/schema/resolver.rb', line 253
+
+def null(allow_null = nil)
+  if !allow_null.nil?
+    @null = allow_null
+  end
+
+  @null.nil? ? (superclass.respond_to?(:null) ? superclass.null : true) : @null
+end
+
+
+ +
+

+ + .resolve_method(new_method = nil) ⇒ Symbol + + + + + +

+
+

Default :resolve set below.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Symbol) + + + + — +

    The method to call on instances of this object to resolve the field

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+231
+232
+233
+234
+235
+236
+
+
# File 'lib/graphql/schema/resolver.rb', line 231
+
+def resolve_method(new_method = nil)
+  if new_method
+    @resolve_method = new_method
+  end
+  @resolve_method || (superclass.respond_to?(:resolve_method) ? superclass.resolve_method : :resolve)
+end
+
+
+ +
+

+ + .resolver_method(new_method_name = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+261
+262
+263
+264
+265
+266
+267
+
+
# File 'lib/graphql/schema/resolver.rb', line 261
+
+def resolver_method(new_method_name = nil)
+  if new_method_name
+    @resolver_method = new_method_name
+  else
+    @resolver_method || :resolve_with_support
+  end
+end
+
+
+ +
+

+ + .type(new_type = nil, null: nil) ⇒ Class + + + + + +

+
+

Call this method to get the return type of the field, +or use it as a configuration method to assign a return type +instead of generating one. +TODO unify with #null

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_type + + + (Class, Array<Class>, nil) + + + (defaults to: nil) + + + — +

    If a type definition class is provided, it will be used as the return type of the field

    +
    + +
  • + +
  • + + null + + + (true, false) + + + (defaults to: nil) + + + — +

    Whether or not the field may return nil

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    The type which this field returns.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+
+
# File 'lib/graphql/schema/resolver.rb', line 276
+
+def type(new_type = nil, null: nil)
+  if new_type
+    if null.nil?
+      raise ArgumentError, "required argument `null:` is missing"
+    end
+    @type_expr = new_type
+    @null = null
+  else
+    if type_expr
+      GraphQL::Schema::Member::BuildType.parse_type(type_expr, null: self.null)
+    elsif superclass.respond_to?(:type)
+      superclass.type
+    else
+      nil
+    end
+  end
+end
+
+
+ +
+

+ + .type_exprObject + + + + + +

+
+

A non-normalized type configuration, without null applied

+ + +
+
+
+ + +
+ + + + +
+
+
+
+359
+360
+361
+
+
# File 'lib/graphql/schema/resolver.rb', line 359
+
+def type_expr
+  @type_expr || (superclass.respond_to?(:type_expr) ? superclass.type_expr : nil)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #argumentsObject + + + + + +

+ + + + +
+
+
+
+58
+59
+60
+
+
# File 'lib/graphql/schema/resolver.rb', line 58
+
+def arguments
+  @prepared_arguments || raise("Arguments have not been prepared yet, still waiting for #load_arguments to resolve. (Call `.arguments` later in the code.)")
+end
+
+
+ +
+

+ + #authorized?(**inputs) ⇒ Boolean, early_return_data + + + + + +

+
+

Called after arguments are loaded, but before resolving.

+ +

Override it to check everything before calling the mutation.

+ + +
+
+
+

Parameters:

+
    + +
  • + + inputs + + + (Hash) + + + + — +

    The input arguments

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean, early_return_data) + + + + — +

    If false, execution will stop (and early_return_data will be returned instead, if present.)

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+147
+148
+149
+150
+151
+
+
# File 'lib/graphql/schema/resolver.rb', line 147
+
+def authorized?(**inputs)
+  arg_owner = @field # || self.class
+  args = arg_owner.arguments(context)
+  authorize_arguments(args, inputs)
+end
+
+
+ +
+

+ + #dataloaderGraphQL::Dataloader + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+51
+52
+53
+
+
# File 'lib/graphql/schema/resolver.rb', line 51
+
+def dataloader
+  context.dataloader
+end
+
+
+ +
+

+ + #ready?(**args) ⇒ Boolean, early_return_data + + + + + +

+
+

Called before arguments are prepared. +Implement this hook to make checks before doing any work.

+ +

If it returns a lazy object (like a promise), it will be synced by GraphQL +(but the resulting value won’t be used).

+ + +
+
+
+

Parameters:

+
    + +
  • + + args + + + (Hash) + + + + — +

    The input arguments, if there are any

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean, early_return_data) + + + + — +

    If false, execution will stop (and early_return_data will be returned instead, if present.)

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+136
+137
+138
+
+
# File 'lib/graphql/schema/resolver.rb', line 136
+
+def ready?(**args)
+  true
+end
+
+
+ +
+

+ + #resolve(**args) ⇒ Object + + + + + +

+
+

Do the work. Everything happens here.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    An object corresponding to the return type

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+122
+123
+124
+
+
# File 'lib/graphql/schema/resolver.rb', line 122
+
+def resolve(**args)
+  raise GraphQL::RequiredImplementationMissingError, "#{self.class.name}#resolve should execute the field's logic"
+end
+
+
+ +
+

+ + #resolve_with_support(**args) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This method is actually called by the runtime, +it does some preparation and then eventually calls +the user-defined #resolve method.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+
+
# File 'lib/graphql/schema/resolver.rb', line 66
+
+def resolve_with_support(**args)
+  # First call the ready? hook which may raise
+  raw_ready_val = if args.any?
+    ready?(**args)
+  else
+    ready?
+  end
+  context.query.after_lazy(raw_ready_val) do |ready_val|
+    if ready_val.is_a?(Array)
+      is_ready, ready_early_return = ready_val
+      if is_ready != false
+        raise "Unexpected result from #ready? (expected `true`, `false` or `[false, {...}]`): [#{is_ready.inspect}, #{ready_early_return.inspect}]"
+      else
+        ready_early_return
+      end
+    elsif ready_val
+      # Then call each prepare hook, which may return a different value
+      # for that argument, or may return a lazy object
+      load_arguments_val = load_arguments(args)
+      context.query.after_lazy(load_arguments_val) do |loaded_args|
+        @prepared_arguments = loaded_args
+        Schema::Validator.validate!(self.class.validators, object, context, loaded_args, as: @field)
+        # Then call `authorized?`, which may raise or may return a lazy object
+        raw_authorized_val = if loaded_args.any?
+          authorized?(**loaded_args)
+        else
+          authorized?
+        end
+        context.query.after_lazy(raw_authorized_val) do |authorized_val|
+          # If the `authorized?` returned two values, `false, early_return`,
+          # then use the early return value instead of continuing
+          if authorized_val.is_a?(Array)
+            authorized_result, early_return = authorized_val
+            if authorized_result == false
+              early_return
+            else
+              raise "Unexpected result from #authorized? (expected `true`, `false` or `[false, {...}]`): [#{authorized_result.inspect}, #{early_return.inspect}]"
+            end
+          elsif authorized_val
+            # Finally, all the hooks have passed, so resolve it
+            if loaded_args.any?
+              public_send(self.class.resolve_method, **loaded_args)
+            else
+              public_send(self.class.resolve_method)
+            end
+          else
+            raise GraphQL::UnauthorizedFieldError.new(context: context, object: object, type: field.owner, field: field)
+          end
+        end
+      end
+    end
+  end
+end
+
+
+ +
+

+ + #unauthorized_object(err) ⇒ Object + + + + + +

+
+

Called when an object loaded by loads: fails the .authorized? check for its resolved GraphQL object type.

+ +

By default, the error is re-raised and passed along to GraphQL::Schema::Resolver.{Schema{Schema.unauthorized_object}.

+ +

Any value returned here will be used instead of of the loaded object.

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+159
+160
+161
+
+
# File 'lib/graphql/schema/resolver.rb', line 159
+
+def unauthorized_object(err)
+  raise err
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Resolver/HasPayloadType.html b/api-doc/2.1.6/GraphQL/Schema/Resolver/HasPayloadType.html new file mode 100644 index 0000000000..534c329fb0 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Resolver/HasPayloadType.html @@ -0,0 +1,603 @@ + + + + + + + Module: GraphQL::Schema::Resolver::HasPayloadType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Resolver::HasPayloadType + + + +

+
+ + + + + + + + + +
+
Included in:
+
Mutation, Subscription
+
+ + + +
+
Defined in:
+
lib/graphql/schema/resolver/has_payload_type.rb
+
+ +
+ +

Overview

+
+

Adds field(...) helper to resolvers so that they can +generate payload types.

+ +

Or, an already-defined one can be attached with payload_type(...).

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
NO_INTERFACES = + +
+
[].freeze
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #field(*args, **kwargs, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+
+
# File 'lib/graphql/schema/resolver/has_payload_type.rb', line 62
+
+def field(*args, **kwargs, &block)
+  pt = payload_type # make sure it's initialized with any inherited fields
+  field_defn = super
+
+  # Remove any inherited fields to avoid false conflicts at runtime
+  prev_fields = pt.own_fields[field_defn.graphql_name]
+  case prev_fields
+  when GraphQL::Schema::Field
+    if prev_fields.owner != self
+      pt.own_fields.delete(field_defn.graphql_name)
+    end
+  when Array
+    prev_fields.reject! { |f| f.owner != self }
+    if prev_fields.empty?
+      pt.own_fields.delete(field_defn.graphql_name)
+    end
+  end
+
+  pt.add_field(field_defn, method_conflict_warning: false)
+  field_defn
+end
+
+
+ +
+

+ + #field_class(new_class = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
+
# File 'lib/graphql/schema/resolver/has_payload_type.rb', line 36
+
+def field_class(new_class = nil)
+  if new_class
+    @field_class = new_class
+  elsif defined?(@field_class) && @field_class
+    @field_class
+  else
+    find_inherited_value(:field_class, GraphQL::Schema::Field)
+  end
+end
+
+
+ +
+

+ + #object_class(new_class = nil) ⇒ Class + + + + + +

+
+

An object class to use for deriving return types

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_class + + + (Class, nil) + + + (defaults to: nil) + + + — +

    Defaults to Object

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Class) + + + +
  • + +
+ +
+ + + + +
+
+
+
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
+
# File 'lib/graphql/schema/resolver/has_payload_type.rb', line 49
+
+def object_class(new_class = nil)
+  if new_class
+    if defined?(@payload_type)
+      raise "Can't configure `object_class(...)` after the payload type has already been initialized. Move this configuration higher up the class definition."
+    end
+    @object_class = new_class
+  else
+    @object_class || find_inherited_value(:object_class, GraphQL::Schema::Object)
+  end
+end
+
+
+ +
+

+ + #payload_type(new_payload_type = nil) ⇒ Class + + + + Also known as: + type_expr + + + + +

+
+

Call this method to get the derived return type of the mutation, +or use it as a configuration method to assign a return type +instead of generating one.

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_payload_type + + + (Class, nil) + + + (defaults to: nil) + + + — +

    If a type definition class is provided, it will be used as the return type of the mutation field

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    The object type which this mutation returns.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/schema/resolver/has_payload_type.rb', line 16
+
+def payload_type(new_payload_type = nil)
+  if new_payload_type
+    @payload_type = new_payload_type
+  end
+  @payload_type ||= generate_payload_type
+end
+
+
+ +
+

+ + #type(new_type = nil, null: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
+
# File 'lib/graphql/schema/resolver/has_payload_type.rb', line 23
+
+def type(new_type = nil, null: nil)
+  if new_type
+    payload_type(new_type)
+    if !null.nil?
+      self.null(null)
+    end
+  else
+    super()
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Scalar.html b/api-doc/2.1.6/GraphQL/Schema/Scalar.html new file mode 100644 index 0000000000..6ff7053fad --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Scalar.html @@ -0,0 +1,736 @@ + + + + + + + Class: GraphQL::Schema::Scalar + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Scalar + + + +

+
+ +
+
Inherits:
+
+ Member + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Member::ValidatesInput
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/schema/scalar.rb
+
+ +
+ + + + + +

Constant Summary

+ +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Member::ValidatesInput

+

coerce_isolated_input, coerce_isolated_result, valid_input?, valid_isolated_input?, validate_input

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(val, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/schema/scalar.rb', line 8
+
+def coerce_input(val, ctx)
+  val
+end
+
+
+ +
+

+ + .coerce_result(val, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/schema/scalar.rb', line 12
+
+def coerce_result(val, ctx)
+  val
+end
+
+
+ +
+

+ + .default_scalar(is_default = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+
+
# File 'lib/graphql/schema/scalar.rb', line 32
+
+def default_scalar(is_default = nil)
+  if !is_default.nil?
+    @default_scalar = is_default
+  end
+  @default_scalar
+end
+
+
+ +
+

+ + .default_scalar?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+39
+40
+41
+
+
# File 'lib/graphql/schema/scalar.rb', line 39
+
+def default_scalar?
+  @default_scalar ||= false
+end
+
+
+ +
+

+ + .kindObject + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/schema/scalar.rb', line 16
+
+def kind
+  GraphQL::TypeKinds::SCALAR
+end
+
+
+ +
+

+ + .specified_by_url(new_url = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
+
# File 'lib/graphql/schema/scalar.rb', line 20
+
+def specified_by_url(new_url = nil)
+  if new_url
+    directive(GraphQL::Schema::Directive::SpecifiedBy, url: new_url)
+  elsif (directive = directives.find { |dir| dir.graphql_name == "specifiedBy" })
+    directive.arguments[:url] # rubocop:disable Development/ContextIsPassedCop
+  elsif superclass.respond_to?(:specified_by_url)
+    superclass.specified_by_url
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + .validate_non_null_input(value, ctx, max_errors: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
+
# File 'lib/graphql/schema/scalar.rb', line 43
+
+def validate_non_null_input(value, ctx, max_errors: nil)
+  coerced_result = begin
+    coerce_input(value, ctx)
+  rescue GraphQL::CoercionError => err
+    err
+  rescue StandardError => err
+    ctx.query.handle_or_reraise(err)
+  end
+
+  if coerced_result.nil?
+    str_value = if value == Float::INFINITY
+      ""
+    else
+      " #{GraphQL::Language.serialize(value)}"
+    end
+    Query::InputValidationResult.from_problem("Could not coerce value#{str_value} to #{graphql_name}")
+  elsif coerced_result.is_a?(GraphQL::CoercionError)
+    Query::InputValidationResult.from_problem(coerced_result.message, message: coerced_result.message, extensions: coerced_result.extensions)
+  else
+    nil
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/SubclassGetReferencesTo.html b/api-doc/2.1.6/GraphQL/Schema/SubclassGetReferencesTo.html new file mode 100644 index 0000000000..3b1fa9a6ce --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/SubclassGetReferencesTo.html @@ -0,0 +1,195 @@ + + + + + + + Module: GraphQL::Schema::SubclassGetReferencesTo + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::SubclassGetReferencesTo + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #get_references_to(type_name) ⇒ Object + + + + + +

+ + + + +
+
+
+
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+
+
# File 'lib/graphql/schema.rb', line 1429
+
+def get_references_to(type_name)
+  own_refs = @own_references_to[type_name]
+  inherited_refs = superclass.references_to(type_name)
+  if inherited_refs&.any?
+    if own_refs&.any?
+      own_refs + inherited_refs
+    else
+      inherited_refs
+    end
+  else
+    own_refs
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Subscription.html b/api-doc/2.1.6/GraphQL/Schema/Subscription.html new file mode 100644 index 0000000000..86372bb93f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Subscription.html @@ -0,0 +1,1348 @@ + + + + + + + Class: GraphQL::Schema::Subscription + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Subscription + + + +

+
+ +
+
Inherits:
+
+ Resolver + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Member::HasFields, Resolver::HasPayloadType
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/schema/subscription.rb
+
+ +
+ +

Overview

+
+

This class can be extended to create fields on your subscription root.

+ +

It provides hooks for the different parts of the subscription lifecycle:

+ +
    +
  • #authorized?: called before initial subscription and subsequent updates
  • +
  • #subscribe: called for the initial subscription
  • +
  • #update: called for subsequent update
  • +
+ +

Also, #unsubscribe terminates the subscription.

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
NO_UPDATE = + +
+
:no_update
+ +
READING_SCOPE = + +
+
::Object.new
+ +
+ + + + + + +

Constants included + from Resolver::HasPayloadType

+

Resolver::HasPayloadType::NO_INTERFACES

+ + + +

Constants included + from Member::HasFields

+

Member::HasFields::CONFLICT_FIELD_NAMES, Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Member::HasArguments

+

Member::HasArguments::NO_ARGUMENTS

+ + + +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Resolver

+

#context, #field, #object

+ + + +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Resolver::HasPayloadType

+

field, field_class, object_class, payload_type, type

+ + + + + + + + + +

Methods included from Member::HasFields

+

add_field, all_field_definitions, field, field_class, global_id_field, own_fields

+ + + + + + + + + +

Methods inherited from Resolver

+

all_field_argument_definitions, any_field_arguments?, argument, #arguments, #authorized?, broadcastable, broadcastable?, complexity, #dataloader, default_page_size, extension, extensions, extras, field_arguments, get_field_argument, has_default_page_size?, has_max_page_size?, max_page_size, null, #ready?, resolve_method, resolver_method, type, type_expr, #unauthorized_object

+ + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::HasArguments

+

#add_argument, #all_argument_definitions, #any_arguments?, #argument, #argument_class, #arguments, #arguments_statically_coercible?, #coerce_arguments, #get_argument, #own_arguments, #remove_argument, #validate_directive_argument

+ + + + + + + + + +

Methods included from Member::HasValidators

+

#validates, #validators

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(object:, context:, field:) ⇒ Subscription + + + + + +

+
+

Returns a new instance of Subscription.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+25
+26
+
+
# File 'lib/graphql/schema/subscription.rb', line 22
+
+def initialize(object:, context:, field:)
+  super
+  # Figure out whether this is an update or an initial subscription
+  @mode = context.query.subscription_update? ? :update : :subscribe
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .subscription_scope(new_scope = READING_SCOPE, optional: false) ⇒ Symbol + + + + + +

+
+

Call this method to provide a new subscription_scope; OR +call it without an argument to get the subscription_scope

+ + +
+
+
+

Parameters:

+
    + +
  • + + new_scope + + + (Symbol) + + + (defaults to: READING_SCOPE) + + +
  • + +
  • + + optional + + + (Boolean) + + + (defaults to: false) + + + — +

    If true, then don’t require scope: to be provided to updates to this subscription.

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Symbol) + + + +
  • + +
+ +
+ + + + +
+
+
+
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+
+
# File 'lib/graphql/schema/subscription.rb', line 115
+
+def self.subscription_scope(new_scope = READING_SCOPE, optional: false)
+  if new_scope != READING_SCOPE
+    @subscription_scope = new_scope
+    @subscription_scope_optional = optional
+  elsif defined?(@subscription_scope)
+    @subscription_scope
+  else
+    find_inherited_value(:subscription_scope)
+  end
+end
+
+
+ +
+

+ + .subscription_scope_optional?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+126
+127
+128
+129
+130
+131
+132
+
+
# File 'lib/graphql/schema/subscription.rb', line 126
+
+def self.subscription_scope_optional?
+  if defined?(@subscription_scope_optional)
+    @subscription_scope_optional
+  else
+    find_inherited_value(:subscription_scope_optional, false)
+  end
+end
+
+
+ +
+

+ + .topic_for(arguments:, field:, scope:) ⇒ String + + + + + +

+
+

This is called during initial subscription to get a “name” for this subscription. +Later, when .trigger is called, this will be called again to build another “name”. +Any subscribers with matching topic will begin the update flow.

+ +

The default implementation creates a string using the field name, subscription scope, and argument keys and values. +In that implementation, only .trigger calls with exact matches result in updates to subscribers.

+ +

To implement a filtered stream-type subscription flow, override this method to return a string with field name and subscription scope. +Then, implement #update to compare its arguments to the current object and return NO_UPDATE when an +update should be filtered out.

+ + +
+
+
+

Parameters:

+
    + +
  • + + arguments + + + (Hash<String => Object>) + + + + — +

    The arguments for this topic, in GraphQL-style (camelized strings)

    +
    + +
  • + +
  • + + field + + + (GraphQL::Schema::Field) + + + +
  • + +
  • + + scope + + + (Object, nil) + + + + — +

    A value corresponding to .trigger(... scope:) (for updates) or the subscription_scope found in context (for initial subscriptions).

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    An identifier corresponding to a stream of updates

    +
    + +
  • + +
+ +

See Also:

+
    + +
  • for how to skip updates when an event comes with a matching topic.
  • + +
+ +
+ + + + +
+
+
+
+150
+151
+152
+
+
# File 'lib/graphql/schema/subscription.rb', line 150
+
+def self.topic_for(arguments:, field:, scope:)
+  Subscriptions::Serialize.dump_recursive([scope, field.graphql_name, arguments])
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #load_application_object_failed(err) ⇒ Object + + + + + +

+
+

If an argument is flagged with loads: and no object is found for it, +remove this subscription (assuming that the object was deleted in the meantime, +or that it became inaccessible).

+ + +
+
+
+ + +
+ + + + +
+
+
+
+94
+95
+96
+97
+98
+99
+
+
# File 'lib/graphql/schema/subscription.rb', line 94
+
+def load_application_object_failed(err)
+  if @mode == :update
+    unsubscribe
+  end
+  super
+end
+
+
+ +
+

+ + #resolve(**args) ⇒ Object + + + + + +

+
+

Implement the Resolve API

+ + +
+
+
+ + +
+ + + + +
+
+
+
+50
+51
+52
+53
+54
+
+
# File 'lib/graphql/schema/subscription.rb', line 50
+
+def resolve(**args)
+  # Dispatch based on `@mode`, which will raise a `NoMethodError` if we ever
+  # have an unexpected `@mode`
+  public_send("resolve_#{@mode}", **args)
+end
+
+
+ +
+

+ + #resolve_subscribe(**args) ⇒ Object + + + + + +

+
+

Wrap the user-defined #subscribe hook

+ + +
+
+
+ + +
+ + + + +
+
+
+
+57
+58
+59
+60
+61
+62
+63
+64
+
+
# File 'lib/graphql/schema/subscription.rb', line 57
+
+def resolve_subscribe(**args)
+  ret_val = args.any? ? subscribe(**args) : subscribe
+  if ret_val == :no_response
+    context.skip
+  else
+    ret_val
+  end
+end
+
+
+ +
+

+ + #resolve_update(**args) ⇒ Object + + + + + +

+
+

Wrap the user-provided #update hook

+ + +
+
+
+ + +
+ + + + +
+
+
+
+74
+75
+76
+77
+78
+79
+80
+81
+82
+
+
# File 'lib/graphql/schema/subscription.rb', line 74
+
+def resolve_update(**args)
+  ret_val = args.any? ? update(**args) : update
+  if ret_val == NO_UPDATE
+    context.namespace(:subscriptions)[:no_update] = true
+    context.skip
+  else
+    ret_val
+  end
+end
+
+
+ +
+

+ + #resolve_with_support(**args) ⇒ Object + + + + + +

+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
+
# File 'lib/graphql/schema/subscription.rb', line 28
+
+def resolve_with_support(**args)
+  result = nil
+  unsubscribed = true
+  unsubscribed_result = catch :graphql_subscription_unsubscribed do
+    result = super
+    unsubscribed = false
+  end
+
+
+  if unsubscribed
+    if unsubscribed_result
+      context.namespace(:subscriptions)[:final_update] = true
+      unsubscribed_result
+    else
+      context.skip
+    end
+  else
+    result
+  end
+end
+
+
+ +
+

+ + #subscribe(args = {}) ⇒ Object + + + + + +

+
+

The default implementation returns nothing on subscribe. +Override it to return an object or +:no_response to (explicitly) return nothing.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/graphql/schema/subscription.rb', line 69
+
+def subscribe(args = {})
+  :no_response
+end
+
+
+ +
+

+ + #unsubscribe(update_value = nil) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Call this to halt execution and remove this subscription from the system

+ + +
+
+
+

Parameters:

+
    + +
  • + + update_value + + + (Object) + + + (defaults to: nil) + + + — +

    if present, deliver this update before unsubscribing

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+104
+105
+106
+107
+
+
# File 'lib/graphql/schema/subscription.rb', line 104
+
+def unsubscribe(update_value = nil)
+  context.namespace(:subscriptions)[:unsubscribed] = true
+  throw :graphql_subscription_unsubscribed, update_value
+end
+
+
+ +
+

+ + #update(args = {}) ⇒ Object + + + + + +

+
+

The default implementation returns the root object. +Override it to return NO_UPDATE if you want to +skip updates sometimes. Or override it to return a different object.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+87
+88
+89
+
+
# File 'lib/graphql/schema/subscription.rb', line 87
+
+def update(args = {})
+  object
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Timeout.html b/api-doc/2.1.6/GraphQL/Schema/Timeout.html new file mode 100644 index 0000000000..c9104fcbcb --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Timeout.html @@ -0,0 +1,527 @@ + + + + + + + Class: GraphQL::Schema::Timeout + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Timeout + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/timeout.rb
+
+ +
+ +

Overview

+
+

This plugin will stop resolving new fields after max_seconds have elapsed. +After the time has passed, any remaining fields will be nil, with errors added +to the errors key. Any already-resolved fields will be in the data key, so +you’ll get a partial response.

+ +

You can subclass GraphQL::Schema::Timeout and override max_seconds and/or handle_timeout +to provide custom logic when a timeout error occurs.

+ +

Note that this will stop a query in between field resolutions, but +it doesn’t interrupt long-running resolve functions. Be sure to use +timeout options for external connections. For more info, see +www.mikeperham.com/2015/05/08/timeout-rubys-most-dangerous-api/

+ + +
+
+
+ +
+

Examples:

+ + +

Stop resolving fields after 2 seconds

+

+ +
class MySchema < GraphQL::Schema
+  use GraphQL::Schema::Timeout, max_seconds: 2
+end
+ + +

Notifying Bugsnag and logging a timeout

+

+ +
class MyTimeout < GraphQL::Schema::Timeout
+  def handle_timeout(error, query)
+     Rails.logger.warn("GraphQL Timeout: #{error.message}: #{query.query_string}")
+     Bugsnag.notify(error, {query_string: query.query_string})
+  end
+end
+
+class MySchema < GraphQL::Schema
+  use MyTimeout, max_seconds: 2
+end
+ +
+ + +

Defined Under Namespace

+

+ + + Modules: Trace + + + + Classes: TimeoutError + + +

+ + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(max_seconds:) ⇒ Timeout + + + + + +

+
+

Returns a new instance of Timeout.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'lib/graphql/schema/timeout.rb', line 41
+
+def initialize(max_seconds:)
+  @max_seconds = max_seconds
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .use(schema, max_seconds: nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+36
+37
+38
+39
+
+
# File 'lib/graphql/schema/timeout.rb', line 36
+
+def self.use(schema, max_seconds: nil)
+  timeout = self.new(max_seconds: max_seconds)
+  schema.trace_with(self::Trace, timeout: timeout)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #handle_timeout(error, query) ⇒ Object + + + + + +

+
+

Invoked when a query times out.

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+101
+102
+103
+
+
# File 'lib/graphql/schema/timeout.rb', line 101
+
+def handle_timeout(error, query)
+  # override to do something interesting
+end
+
+
+ +
+

+ + #max_seconds(query) ⇒ Numeric, false + + + + + +

+
+

Called at the start of each query. +The default implementation returns the max_seconds: value from installing this plugin.

+ + +
+
+
+

Parameters:

+
    + +
  • + + query + + + (GraphQL::Query) + + + + — +

    The query that’s about to run

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Numeric, false) + + + + — +

    The number of seconds after which to interrupt query execution and call #handle_error, or false to bypass the timeout.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+94
+95
+96
+
+
# File 'lib/graphql/schema/timeout.rb', line 94
+
+def max_seconds(query)
+  @max_seconds
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Timeout/TimeoutError.html b/api-doc/2.1.6/GraphQL/Schema/Timeout/TimeoutError.html new file mode 100644 index 0000000000..0e1dbdbc1d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Timeout/TimeoutError.html @@ -0,0 +1,246 @@ + + + + + + + Exception: GraphQL::Schema::Timeout::TimeoutError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::Timeout::TimeoutError + + + +

+
+ +
+
Inherits:
+
+ ExecutionError + +
    +
  • Object
  • + + + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/timeout.rb
+
+ +
+ +

Overview

+
+

This error is raised when a query exceeds max_seconds. +Since it’s a child of ExecutionError, +its message will be added to the response’s errors key.

+ +

To raise an error that will stop query resolution, use a custom block +to take this error and raise a new one which doesn’t descend from ExecutionError, +such as RuntimeError.

+ + +
+
+
+ + +
+ + + + + +

Instance Attribute Summary

+ +

Attributes inherited from ExecutionError

+

#ast_node, #extensions, #options, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from ExecutionError

+

#to_h

+ + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(field) ⇒ TimeoutError + + + + + +

+
+

Returns a new instance of TimeoutError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+113
+114
+115
+
+
# File 'lib/graphql/schema/timeout.rb', line 113
+
+def initialize(field)
+  super("Timeout on #{field.path}")
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Timeout/Trace.html b/api-doc/2.1.6/GraphQL/Schema/Timeout/Trace.html new file mode 100644 index 0000000000..fe39361963 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Timeout/Trace.html @@ -0,0 +1,368 @@ + + + + + + + Module: GraphQL::Schema::Timeout::Trace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::Timeout::Trace + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/timeout.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #execute_field(query:, field:, **_rest) ⇒ Object + + + + + +

+ + + + +
+
+
+
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+
+
# File 'lib/graphql/schema/timeout.rb', line 71
+
+def execute_field(query:, field:, **_rest)
+  timeout_state = query.context.namespace(@timeout).fetch(:state)
+  # If the `:state` is `false`, then `max_seconds(query)` opted out of timeout for this query.
+  if timeout_state != false && Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond) > timeout_state.fetch(:timeout_at)
+    error = GraphQL::Schema::Timeout::TimeoutError.new(field)
+    # Only invoke the timeout callback for the first timeout
+    if !timeout_state[:timed_out]
+      timeout_state[:timed_out] = true
+      @timeout.handle_timeout(error, query)
+    end
+
+    error
+  else
+    super
+  end
+end
+
+
+ +
+

+ + #execute_multiplex(multiplex:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+
+
# File 'lib/graphql/schema/timeout.rb', line 52
+
+def execute_multiplex(multiplex:)
+  multiplex.queries.each do |query|
+    timeout_duration_s = @timeout.max_seconds(query)
+    timeout_state = if timeout_duration_s == false
+      # if the method returns `false`, don't apply a timeout
+      false
+    else
+      now = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
+      timeout_at = now + (timeout_duration_s * 1000)
+      {
+        timeout_at: timeout_at,
+        timed_out: false
+      }
+    end
+    query.context.namespace(@timeout)[:state] = timeout_state
+  end
+  super
+end
+
+
+ +
+

+ + #initialize(timeout:, **rest) ⇒ Object + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + max_seconds + + + (Numeric) + + + + — +

    how many seconds the query should be allowed to resolve new fields

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+47
+48
+49
+50
+
+
# File 'lib/graphql/schema/timeout.rb', line 47
+
+def initialize(timeout:, **rest)
+  @timeout = timeout
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/TypeExpression.html b/api-doc/2.1.6/GraphQL/Schema/TypeExpression.html new file mode 100644 index 0000000000..acb51489b5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/TypeExpression.html @@ -0,0 +1,273 @@ + + + + + + + Module: GraphQL::Schema::TypeExpression + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::TypeExpression + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/type_expression.rb
+
+ +
+ +
+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .build_type(type_owner, ast_node) ⇒ Class, ... + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Fetch a type from a type map by its AST specification. +Return nil if not found.

+ + +
+
+
+

Parameters:

+ + +

Returns:

+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
+
# File 'lib/graphql/schema/type_expression.rb', line 11
+
+def self.build_type(type_owner, ast_node)
+  case ast_node
+  when GraphQL::Language::Nodes::TypeName
+    type_owner.get_type(ast_node.name) # rubocop:disable Development/ContextIsPassedCop -- this is a `context` or `warden`, it's already query-aware
+  when GraphQL::Language::Nodes::NonNullType
+    ast_inner_type = ast_node.of_type
+    inner_type = build_type(type_owner, ast_inner_type)
+    wrap_type(inner_type, :to_non_null_type)
+  when GraphQL::Language::Nodes::ListType
+    ast_inner_type = ast_node.of_type
+    inner_type = build_type(type_owner, ast_inner_type)
+    wrap_type(inner_type, :to_list_type)
+  else
+    raise "Invariant: unexpected type from ast: #{ast_node.inspect}"
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/TypeMembership.html b/api-doc/2.1.6/GraphQL/Schema/TypeMembership.html new file mode 100644 index 0000000000..229b71ec44 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/TypeMembership.html @@ -0,0 +1,764 @@ + + + + + + + Class: GraphQL::Schema::TypeMembership + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::TypeMembership + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/type_membership.rb
+
+ +
+ +

Overview

+
+

This class joins an object type to an abstract type (interface or union) of which +it is a member.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(abstract_type, object_type, **options) ⇒ TypeMembership + + + + + +

+
+

Called when an object is hooked up to an abstract type, such as Union.possible_types +or Schema::Object.implements (for interfaces).

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+
+
# File 'lib/graphql/schema/type_membership.rb', line 23
+
+def initialize(abstract_type, object_type, **options)
+  @abstract_type = abstract_type
+  @object_type = object_type
+  @options = options
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #abstract_typeClass<GraphQL::Schema::Union>, Module<GraphQL::Schema::Interface> (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/schema/type_membership.rb', line 12
+
+def abstract_type
+  @abstract_type
+end
+
+
+ + + +
+

+ + #object_typeClass<GraphQL::Schema::Object> + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/schema/type_membership.rb', line 9
+
+def object_type
+  @object_type
+end
+
+
+ + + +
+

+ + #optionsHash (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash) + + + +
  • + +
+ +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/schema/type_membership.rb', line 15
+
+def options
+  @options
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #graphql_nameObject + + + + + +

+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/schema/type_membership.rb', line 36
+
+def graphql_name
+  "#{@object_type.graphql_name}.#{@abstract_type.kind.interface? ? "implements" : "belongsTo" }.#{@abstract_type.graphql_name}"
+end
+
+
+ +
+

+ + #inspectObject + + + + + +

+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'lib/graphql/schema/type_membership.rb', line 44
+
+def inspect
+  "#<#{self.class} #{@object_type.inspect} => #{@abstract_type.inspect}>"
+end
+
+
+ +
+

+ + #pathObject + + + + + +

+ + + + +
+
+
+
+40
+41
+42
+
+
# File 'lib/graphql/schema/type_membership.rb', line 40
+
+def path
+  graphql_name
+end
+
+
+ +
+

+ + #visible?(ctx) ⇒ Boolean + + + + + +

+
+

Returns if false, #object_type will be treated as not a member of #abstract_type.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+30
+31
+32
+33
+34
+
+
# File 'lib/graphql/schema/type_membership.rb', line 30
+
+def visible?(ctx)
+  warden = Warden.from_context(ctx)
+  (@object_type.respond_to?(:visible?) ? warden.visible_type?(@object_type, ctx) : true) &&
+    (@abstract_type.respond_to?(:visible?) ? warden.visible_type?(@abstract_type, ctx) : true)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Union.html b/api-doc/2.1.6/GraphQL/Schema/Union.html new file mode 100644 index 0000000000..a5e574f020 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Union.html @@ -0,0 +1,665 @@ + + + + + + + Class: GraphQL::Schema::Union + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Union + + + +

+
+ +
+
Inherits:
+
+ Member + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Member::HasUnresolvedTypeError
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/schema/union.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Member::GraphQLTypeNames

+

Member::GraphQLTypeNames::Boolean, Member::GraphQLTypeNames::ID, Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .all_possible_typesObject + + + + + +

+ + + + +
+
+
+
+31
+32
+33
+
+
# File 'lib/graphql/schema/union.rb', line 31
+
+def all_possible_types
+  type_memberships.map(&:object_type)
+end
+
+
+ +
+

+ + .assign_type_membership_object_type(object_type) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Update a type membership whose .object_type is a string or late-bound type +so that the type membership’s .object_type is the given object_type. +(This is used for updating the union after the schema as lazily loaded the union member.)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
+
# File 'lib/graphql/schema/union.rb', line 55
+
+def assign_type_membership_object_type(object_type)
+  assert_valid_union_member(object_type)
+  type_memberships.each { |tm|
+    possible_type = tm.object_type
+    if possible_type.is_a?(String) && (possible_type == object_type.name)
+      # This is a match of Ruby class names, not graphql names,
+      # since strings are used to refer to constants.
+      tm.object_type = object_type
+    elsif possible_type.is_a?(LateBoundType) && possible_type.graphql_name == object_type.graphql_name
+      tm.object_type = object_type
+    end
+  }
+  nil
+end
+
+
+ +
+

+ + .kindObject + + + + + +

+ + + + +
+
+
+
+43
+44
+45
+
+
# File 'lib/graphql/schema/union.rb', line 43
+
+def kind
+  GraphQL::TypeKinds::UNION
+end
+
+
+ +
+

+ + .possible_types(*types, context: GraphQL::Query::NullContext.instance, **options) ⇒ Object + + + + + +

+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
+
# File 'lib/graphql/schema/union.rb', line 13
+
+def possible_types(*types, context: GraphQL::Query::NullContext.instance, **options)
+  if types.any?
+    types.each do |t|
+      assert_valid_union_member(t)
+      type_memberships << type_membership_class.new(self, t, **options)
+    end
+  else
+    visible_types = []
+    warden = Warden.from_context(context)
+    type_memberships.each do |type_membership|
+      if warden.visible_type_membership?(type_membership, context)
+        visible_types << type_membership.object_type
+      end
+    end
+    visible_types
+  end
+end
+
+
+ +
+

+ + .type_membership_class(membership_class = nil) ⇒ Object + + + + + +

+ + + + +
+
+
+
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'lib/graphql/schema/union.rb', line 35
+
+def type_membership_class(membership_class = nil)
+  if membership_class
+    @type_membership_class = membership_class
+  else
+    @type_membership_class || find_inherited_value(:type_membership_class, GraphQL::Schema::TypeMembership)
+  end
+end
+
+
+ +
+

+ + .type_membershipsObject + + + + + +

+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/schema/union.rb', line 47
+
+def type_memberships
+  @type_memberships ||= []
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/UniqueWithinType.html b/api-doc/2.1.6/GraphQL/Schema/UniqueWithinType.html new file mode 100644 index 0000000000..e572fb7351 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/UniqueWithinType.html @@ -0,0 +1,417 @@ + + + + + + + Module: GraphQL::Schema::UniqueWithinType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Schema::UniqueWithinType + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/unique_within_type.rb
+
+ +
+ + + + + +

Class Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + + + +
+

Class Attribute Details

+ + + +
+

+ + .default_id_separatorObject + + + + + +

+
+

Returns the value of attribute default_id_separator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/schema/unique_within_type.rb', line 8
+
+def default_id_separator
+  @default_id_separator
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .decode(node_id, separator: self.default_id_separator) ⇒ Array<(String, String)> + + + + + +

+
+

Returns The type name & value passed to encode.

+ + +
+
+
+

Parameters:

+
    + +
  • + + node_id + + + (String) + + + + — +

    A unique ID generated by encode

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array<(String, String)>) + + + + — +

    The type name & value passed to encode

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/graphql/schema/unique_within_type.rb', line 29
+
+def decode(node_id, separator: self.default_id_separator)
+  GraphQL::Schema::Base64Encoder.decode(node_id).split(separator, 2)
+end
+
+
+ +
+

+ + .encode(type_name, object_value, separator: self.default_id_separator) ⇒ String + + + + + +

+
+

Returns a unique, opaque ID generated as a function of the two inputs.

+ + +
+
+
+

Parameters:

+
    + +
  • + + type_name + + + (String) + + + +
  • + +
  • + + object_value + + + (Any) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    a unique, opaque ID generated as a function of the two inputs

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/schema/unique_within_type.rb', line 17
+
+def encode(type_name, object_value, separator: self.default_id_separator)
+  object_value_str = object_value.to_s
+
+  if type_name.include?(separator)
+    raise "encode(#{type_name}, #{object_value_str}) contains reserved characters `#{separator}` in the type name"
+  end
+
+  Base64.strict_encode64([type_name, object_value_str].join(separator))
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/UnresolvedLateBoundTypeError.html b/api-doc/2.1.6/GraphQL/Schema/UnresolvedLateBoundTypeError.html new file mode 100644 index 0000000000..7f778ba50d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/UnresolvedLateBoundTypeError.html @@ -0,0 +1,294 @@ + + + + + + + Exception: GraphQL::Schema::UnresolvedLateBoundTypeError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::UnresolvedLateBoundTypeError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #type ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(type:) ⇒ UnresolvedLateBoundTypeError + + + + + +

+
+

Returns a new instance of UnresolvedLateBoundTypeError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+93
+94
+95
+96
+
+
# File 'lib/graphql/schema.rb', line 93
+
+def initialize(type:)
+  @type = type
+  super("Late bound type was never found: #{type.inspect}")
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #typeObject (readonly) + + + + + +

+
+

Returns the value of attribute type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+92
+93
+94
+
+
# File 'lib/graphql/schema.rb', line 92
+
+def type
+  @type
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Validator.html b/api-doc/2.1.6/GraphQL/Schema/Validator.html new file mode 100644 index 0000000000..91b2246e58 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Validator.html @@ -0,0 +1,1278 @@ + + + + + + + Class: GraphQL::Schema::Validator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Validator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
EmptyObjects
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/validator.rb,
+ lib/graphql/schema/validator/format_validator.rb,
lib/graphql/schema/validator/length_validator.rb,
lib/graphql/schema/validator/required_validator.rb,
lib/graphql/schema/validator/exclusion_validator.rb,
lib/graphql/schema/validator/inclusion_validator.rb,
lib/graphql/schema/validator/allow_null_validator.rb,
lib/graphql/schema/validator/allow_blank_validator.rb,
lib/graphql/schema/validator/numericality_validator.rb
+
+
+ +
+ + +

Defined Under Namespace

+

+ + + + + Classes: AllowBlankValidator, AllowNullValidator, ExclusionValidator, FormatValidator, InclusionValidator, LengthValidator, NumericalityValidator, RequiredValidator, ValidationFailedError + + +

+ + + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + +

Class Attribute Summary collapse

+ + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(validated:, allow_blank: false, allow_null: false) ⇒ Validator + + + + + +

+
+

Returns a new instance of Validator.

+ + +
+
+
+

Parameters:

+
    + +
  • + + validated + + + (GraphQL::Schema::Argument, GraphQL::Schema::Field, GraphQL::Schema::Resolver, Class<GraphQL::Schema::InputObject>) + + + + — +

    The argument or argument owner this validator is attached to

    +
    + +
  • + +
  • + + allow_blank + + + (Boolean) + + + (defaults to: false) + + + — +

    if true, then objects that respond to .blank? and return true for .blank? will skip this validation

    +
    + +
  • + +
  • + + allow_null + + + (Boolean) + + + (defaults to: false) + + + — +

    if true, then incoming nulls will skip this validation

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/schema/validator.rb', line 13
+
+def initialize(validated:, allow_blank: false, allow_null: false)
+  @validated = validated
+  @allow_blank = allow_blank
+  @allow_null = allow_null
+end
+
+
+ +
+ +
+

Class Attribute Details

+ + + +
+

+ + .all_validatorsObject + + + + + +

+
+

Returns the value of attribute all_validators.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'lib/graphql/schema/validator.rb', line 100
+
+def all_validators
+  @all_validators
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #validatedGraphQL::Schema::Argument, ... (readonly) + + + + + +

+
+

The thing being validated

+ + +
+
+ + + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/schema/validator.rb', line 8
+
+def validated
+  @validated
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .from_config(schema_member, validates_hash) ⇒ Array<Validator> + + + + + +

+
+ + + +
+
+
+

Parameters:

+ + +

Returns:

+ + +
+ + + + +
+
+
+
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+
+
# File 'lib/graphql/schema/validator.rb', line 46
+
+def self.from_config(schema_member, validates_hash)
+  if validates_hash.nil? || validates_hash.empty?
+    EMPTY_ARRAY
+  else
+    validates_hash = validates_hash.dup
+
+    default_options = {}
+    if validates_hash[:allow_null]
+      default_options[:allow_null] = validates_hash.delete(:allow_null)
+    end
+    if validates_hash[:allow_blank]
+      default_options[:allow_blank] = validates_hash.delete(:allow_blank)
+    end
+
+    # allow_nil or allow_blank are the _only_ validations:
+    if validates_hash.empty?
+      validates_hash = default_options
+    end
+
+    validates_hash.map do |validator_name, options|
+      validator_class = case validator_name
+      when Class
+        validator_name
+      else
+        all_validators[validator_name] || raise(ArgumentError, "unknown validation: #{validator_name.inspect}")
+      end
+      if options.is_a?(Hash)
+        validator_class.new(validated: schema_member, **(default_options.merge(options)))
+      else
+        validator_class.new(options, validated: schema_member, **default_options)
+      end
+    end
+  end
+end
+
+
+ +
+

+ + .install(name, validator_class) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Add validator_class to be initialized when validates: is given name. +(It’s initialized with whatever options are given by the key name).

+ + +
+
+
+

Parameters:

+
    + +
  • + + name + + + (Symbol) + + + +
  • + +
  • + + validator_class + + + (Class) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+86
+87
+88
+89
+
+
# File 'lib/graphql/schema/validator.rb', line 86
+
+def self.install(name, validator_class)
+  all_validators[name] = validator_class
+  nil
+end
+
+
+ +
+

+ + .uninstall(name) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Remove whatever validator class is installed at name, if there is one

+ + +
+
+
+

Parameters:

+
    + +
  • + + name + + + (Symbol) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+94
+95
+96
+97
+
+
# File 'lib/graphql/schema/validator.rb', line 94
+
+def self.uninstall(name)
+  all_validators.delete(name)
+  nil
+end
+
+
+ +
+

+ + .validate!(validators, object, context, value, as: nil) ⇒ void + + + + + +

+
+

This method returns an undefined value.

+ + +
+
+
+

Parameters:

+
    + +
  • + + validators + + + (Array<Validator>) + + + +
  • + +
  • + + object + + + (Object) + + + +
  • + +
  • + + context + + + (Query::Context) + + + +
  • + +
  • + + value + + + (Object) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+
+
# File 'lib/graphql/schema/validator.rb', line 122
+
+def self.validate!(validators, object, context, value, as: nil)
+  # Assuming the default case is no errors, reduce allocations in that case.
+  # This will be replaced with a mutable array if we actually get any errors.
+  all_errors = EMPTY_ARRAY
+
+  validators.each do |validator|
+    validated = as || validator.validated
+    errors = validator.validate(object, context, value)
+    if errors &&
+        (errors.is_a?(Array) && errors != EMPTY_ARRAY) ||
+        (errors.is_a?(String))
+      if all_errors.frozen? # It's empty
+        all_errors = []
+      end
+      interpolation_vars = { validated: validated.graphql_name, value: value.inspect }
+      if errors.is_a?(String)
+        all_errors << (errors % interpolation_vars)
+      else
+        errors = errors.map { |e| e % interpolation_vars }
+        all_errors.concat(errors)
+      end
+    end
+  end
+
+  if all_errors.any?
+    raise ValidationFailedError.new(errors: all_errors)
+  end
+  nil
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #partial_format(string, substitutions) ⇒ Object + + + + + +

+
+

This is like String#%, but it supports the case that only some of string’s +values are present in substitutions

+ + +
+
+
+ + +
+ + + + +
+
+
+
+29
+30
+31
+32
+33
+34
+35
+
+
# File 'lib/graphql/schema/validator.rb', line 29
+
+def partial_format(string, substitutions)
+  substitutions.each do |key, value|
+    sub_v = value.is_a?(String) ? value : value.to_s
+    string = string.gsub("%{#{key}}", sub_v)
+  end
+  string
+end
+
+
+ +
+

+ + #permitted_empty_value?(value) ⇒ Boolean + + + + + +

+
+

Returns true if value is nil and this validator has allow_null: true or if value is .blank? and this validator has allow_blank: true.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    true if value is nil and this validator has allow_null: true or if value is .blank? and this validator has allow_blank: true

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+38
+39
+40
+41
+
+
# File 'lib/graphql/schema/validator.rb', line 38
+
+def permitted_empty_value?(value)
+  (value.nil? && @allow_null) ||
+    (@allow_blank && value.respond_to?(:blank?) && value.blank?)
+end
+
+
+ +
+

+ + #validate(object, context, value) ⇒ nil, ... + + + + + +

+
+

Returns Error message or messages to add.

+ + +
+
+
+

Parameters:

+
    + +
  • + + object + + + (Object) + + + + — +

    The application object that this argument’s field is being resolved for

    +
    + +
  • + +
  • + + context + + + (GraphQL::Query::Context) + + + +
  • + +
  • + + value + + + (Object) + + + + — +

    The client-provided value for this argument (after parsing and coercing by the input type)

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (nil, Array<String>, String) + + + + — +

    Error message or messages to add

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/graphql/schema/validator.rb', line 23
+
+def validate(object, context, value)
+  raise GraphQL::RequiredImplementationMissingError, "Validator classes should implement #validate"
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Validator/AllowBlankValidator.html b/api-doc/2.1.6/GraphQL/Schema/Validator/AllowBlankValidator.html new file mode 100644 index 0000000000..67c8e76fbf --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Validator/AllowBlankValidator.html @@ -0,0 +1,327 @@ + + + + + + + Class: GraphQL::Schema::Validator::AllowBlankValidator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Validator::AllowBlankValidator + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Validator + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/validator/allow_blank_validator.rb
+
+ +
+ +

Overview

+
+

Use this to specifically reject values that respond to .blank? and respond truthy for that method.

+ + +
+
+
+ +
+

Examples:

+ + +

Require a non-empty string for an argument

+

+ +
argument :name, String, required: true, validate: { allow_blank: false }
+ +
+ + +
+ + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Validator

+

#validated

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Validator

+

from_config, install, #partial_format, #permitted_empty_value?, uninstall, validate!

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(allow_blank_positional, allow_blank: nil, message: "%{validated} can't be blank", **default_options) ⇒ AllowBlankValidator + + + + + +

+
+

Returns a new instance of AllowBlankValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+15
+
+
# File 'lib/graphql/schema/validator/allow_blank_validator.rb', line 11
+
+def initialize(allow_blank_positional, allow_blank: nil, message: "%{validated} can't be blank", **default_options)
+  @message = message
+  super(**default_options)
+  @allow_blank = allow_blank.nil? ? allow_blank_positional : allow_blank
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #validate(_object, _context, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/schema/validator/allow_blank_validator.rb', line 17
+
+def validate(_object, _context, value)
+  if value.respond_to?(:blank?) && value.blank?
+    if (value.nil? && @allow_null) || @allow_blank
+      # pass
+    else
+      @message
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Validator/AllowNullValidator.html b/api-doc/2.1.6/GraphQL/Schema/Validator/AllowNullValidator.html new file mode 100644 index 0000000000..34af2ce1a2 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Validator/AllowNullValidator.html @@ -0,0 +1,335 @@ + + + + + + + Class: GraphQL::Schema::Validator::AllowNullValidator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Validator::AllowNullValidator + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Validator + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/validator/allow_null_validator.rb
+
+ +
+ +

Overview

+
+

Use this to specifically reject or permit nil values (given as null from GraphQL).

+ + +
+
+
+ +
+

Examples:

+ + +

require a non-null value for an argument if it is provided

+

+ +
argument :name, String, required: false, validates: { allow_null: false }
+ +
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
MESSAGE = + +
+
"%{validated} can't be null"
+ +
+ + + + + + +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Validator

+

#validated

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Validator

+

from_config, install, #partial_format, #permitted_empty_value?, uninstall, validate!

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(allow_null_positional, allow_null: nil, message: MESSAGE, **default_options) ⇒ AllowNullValidator + + + + + +

+
+

Returns a new instance of AllowNullValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+12
+13
+14
+15
+16
+
+
# File 'lib/graphql/schema/validator/allow_null_validator.rb', line 12
+
+def initialize(allow_null_positional, allow_null: nil, message: MESSAGE, **default_options)
+  @message = message
+  super(**default_options)
+  @allow_null = allow_null.nil? ? allow_null_positional : allow_null
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #validate(_object, _context, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/schema/validator/allow_null_validator.rb', line 18
+
+def validate(_object, _context, value)
+  if value.nil? && !@allow_null
+    @message
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Validator/ExclusionValidator.html b/api-doc/2.1.6/GraphQL/Schema/Validator/ExclusionValidator.html new file mode 100644 index 0000000000..e7b405ea9f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Validator/ExclusionValidator.html @@ -0,0 +1,359 @@ + + + + + + + Class: GraphQL::Schema::Validator::ExclusionValidator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Validator::ExclusionValidator + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Validator + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/validator/exclusion_validator.rb
+
+ +
+ +

Overview

+
+

Use this to specifically reject values from an argument.

+ + +
+
+
+ +
+

Examples:

+ + +

disallow certain values

+

+ +

+argument :favorite_non_prime, Integer, required: true,
+  validates: { exclusion: { in: [2, 3, 5, 7, ... ]} }
+ +
+ + +
+ + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Validator

+

#validated

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Validator

+

from_config, install, #partial_format, #permitted_empty_value?, uninstall, validate!

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message: "%{validated} is reserved", in:, **default_options) ⇒ ExclusionValidator + + + + + +

+
+

Returns a new instance of ExclusionValidator.

+ + +
+
+
+

Parameters:

+
    + +
  • + + message + + + (String) + + + (defaults to: "%{validated} is reserved") + + +
  • + +
  • + + in + + + (Array) + + + + — +

    The values to reject

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/schema/validator/exclusion_validator.rb', line 16
+
+def initialize(message: "%{validated} is reserved", in:, **default_options)
+  # `in` is a reserved word, so work around that
+  @in_list = binding.local_variable_get(:in)
+  @message = message
+  super(**default_options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #validate(_object, _context, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+
+
# File 'lib/graphql/schema/validator/exclusion_validator.rb', line 23
+
+def validate(_object, _context, value)
+  if permitted_empty_value?(value)
+    # pass
+  elsif @in_list.include?(value)
+    @message
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Validator/FormatValidator.html b/api-doc/2.1.6/GraphQL/Schema/Validator/FormatValidator.html new file mode 100644 index 0000000000..9367c0e5fe --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Validator/FormatValidator.html @@ -0,0 +1,394 @@ + + + + + + + Class: GraphQL::Schema::Validator::FormatValidator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Validator::FormatValidator + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Validator + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/validator/format_validator.rb
+
+ +
+ +

Overview

+
+

Use this to assert that string values match (or don’t match) the given RegExp.

+ + +
+
+
+ +
+

Examples:

+ + +

requiring input to match a pattern

+

+ +

+argument :handle, String, required: true,
+  validates: { format: { with: /\A[a-z0-9_]+\Z/ } }
+ + +

reject inputs that match a pattern

+

+ +

+argument :word_that_doesnt_begin_with_a_vowel, String, required: true,
+  validates: { format: { without: /\A[aeiou]/ } }
+
+# It's pretty hard to come up with a legitimate use case for `without:`
+ +
+ + +
+ + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Validator

+

#validated

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Validator

+

from_config, install, #partial_format, #permitted_empty_value?, uninstall, validate!

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(with: nil, without: nil, message: "%{validated} is invalid", **default_options) ⇒ FormatValidator + + + + + +

+
+

Returns a new instance of FormatValidator.

+ + +
+
+
+

Parameters:

+
    + +
  • + + with + + + (RegExp, nil) + + + (defaults to: nil) + + +
  • + +
  • + + without + + + (Regexp, nil) + + + (defaults to: nil) + + +
  • + +
  • + + message + + + (String) + + + (defaults to: "%{validated} is invalid") + + +
  • + +
+ + +
+ + + + +
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'lib/graphql/schema/validator/format_validator.rb', line 24
+
+def initialize(
+  with: nil,
+  without: nil,
+  message: "%{validated} is invalid",
+  **default_options
+)
+  @with_pattern = with
+  @without_pattern = without
+  @message = message
+  super(**default_options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #validate(_object, _context, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+
+
# File 'lib/graphql/schema/validator/format_validator.rb', line 36
+
+def validate(_object, _context, value)
+  if permitted_empty_value?(value)
+    # Do nothing
+  elsif value.nil? ||
+      (@with_pattern && !value.match?(@with_pattern)) ||
+      (@without_pattern && value.match?(@without_pattern))
+    @message
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Validator/InclusionValidator.html b/api-doc/2.1.6/GraphQL/Schema/Validator/InclusionValidator.html new file mode 100644 index 0000000000..42af4b6fba --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Validator/InclusionValidator.html @@ -0,0 +1,361 @@ + + + + + + + Class: GraphQL::Schema::Validator::InclusionValidator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Validator::InclusionValidator + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Validator + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/validator/inclusion_validator.rb
+
+ +
+ +

Overview

+
+

You can use this to allow certain values for an argument.

+ +

Usually, a Enum is better for this, because it’s self-documenting.

+ + +
+
+
+ +
+

Examples:

+ + +

only allow certain values for an argument

+

+ +

+argument :favorite_prime, Integer, required: true,
+  validates: { inclusion: { in: [2, 3, 5, 7, 11, ... ] } }
+ +
+ + +
+ + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Validator

+

#validated

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Validator

+

from_config, install, #partial_format, #permitted_empty_value?, uninstall, validate!

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(in:, message: "%{validated} is not included in the list", **default_options) ⇒ InclusionValidator + + + + + +

+
+

Returns a new instance of InclusionValidator.

+ + +
+
+
+

Parameters:

+
    + +
  • + + message + + + (String) + + + (defaults to: "%{validated} is not included in the list") + + +
  • + +
  • + + in + + + (Array) + + + + — +

    The values to allow

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+
+
# File 'lib/graphql/schema/validator/inclusion_validator.rb', line 18
+
+def initialize(in:, message: "%{validated} is not included in the list", **default_options)
+  # `in` is a reserved word, so work around that
+  @in_list = binding.local_variable_get(:in)
+  @message = message
+  super(**default_options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #validate(_object, _context, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+
+
# File 'lib/graphql/schema/validator/inclusion_validator.rb', line 25
+
+def validate(_object, _context, value)
+  if permitted_empty_value?(value)
+    # pass
+  elsif !@in_list.include?(value)
+    @message
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Validator/LengthValidator.html b/api-doc/2.1.6/GraphQL/Schema/Validator/LengthValidator.html new file mode 100644 index 0000000000..26a6405ab6 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Validator/LengthValidator.html @@ -0,0 +1,495 @@ + + + + + + + Class: GraphQL::Schema::Validator::LengthValidator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Validator::LengthValidator + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Validator + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/validator/length_validator.rb
+
+ +
+ +

Overview

+
+

Use this to enforce a .length restriction on incoming values. It works for both Strings and Lists.

+ + +
+
+
+ +
+

Examples:

+ + +

Allow no more than 10 IDs

+

+ +

+argument :ids, [ID], required: true, validates: { length: { maximum: 10 } }
+ + +

Require three selections

+

+ +

+argument :ice_cream_preferences, [ICE_CREAM_FLAVOR], required: true, validates: { length: { is: 3 } }
+ +
+ + +
+ + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Validator

+

#validated

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Validator

+

from_config, install, #partial_format, #permitted_empty_value?, uninstall, validate!

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(maximum: nil, too_long: "%{validated} is too long (maximum is %{count})", minimum: nil, too_short: "%{validated} is too short (minimum is %{count})", is: nil, within: nil, wrong_length: "%{validated} is the wrong length (should be %{count})", message: nil, **default_options) ⇒ LengthValidator + + + + + +

+
+

Returns a new instance of LengthValidator.

+ + +
+
+
+

Parameters:

+
    + +
  • + + maximum + + + (Integer) + + + (defaults to: nil) + + +
  • + +
  • + + too_long + + + (String) + + + (defaults to: "%{validated} is too long (maximum is %{count})") + + + — +

    Used when maximum is exceeded or value is greater than within

    +
    + +
  • + +
  • + + minimum + + + (Integer) + + + (defaults to: nil) + + +
  • + +
  • + + too_short + + + (String) + + + (defaults to: "%{validated} is too short (minimum is %{count})") + + + — +

    Used with value is less than minimum or less than within

    +
    + +
  • + +
  • + + is + + + (Integer) + + + (defaults to: nil) + + + — +

    Exact length requirement

    +
    + +
  • + +
  • + + wrong_length + + + (String) + + + (defaults to: "%{validated} is the wrong length (should be %{count})") + + + — +

    Used when value doesn’t match is

    +
    + +
  • + +
  • + + within + + + (Range) + + + (defaults to: nil) + + + — +

    An allowed range (becomes minimum: and maximum: under the hood)

    +
    + +
  • + +
  • + + message + + + (String) + + + (defaults to: nil) + + +
  • + +
+ + +
+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
+
# File 'lib/graphql/schema/validator/length_validator.rb', line 25
+
+def initialize(
+  maximum: nil, too_long: "%{validated} is too long (maximum is %{count})",
+  minimum: nil, too_short: "%{validated} is too short (minimum is %{count})",
+  is: nil, within: nil, wrong_length: "%{validated} is the wrong length (should be %{count})",
+  message: nil,
+  **default_options
+)
+  if within && (minimum || maximum)
+    raise ArgumentError, "`length: { ... }` may include `within:` _or_ `minimum:`/`maximum:`, but not both"
+  end
+  # Under the hood, `within` is decomposed into `minimum` and `maximum`
+  @maximum = maximum || (within && within.max)
+  @too_long = message || too_long
+  @minimum = minimum || (within && within.min)
+  @too_short = message || too_short
+  @is = is
+  @wrong_length = message || wrong_length
+  super(**default_options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #validate(_object, _context, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
+
# File 'lib/graphql/schema/validator/length_validator.rb', line 45
+
+def validate(_object, _context, value)
+  return if permitted_empty_value?(value) # pass in this case
+  length = value.nil? ? 0 : value.length
+  if @maximum && length > @maximum
+    partial_format(@too_long, { count: @maximum })
+  elsif @minimum && length < @minimum
+    partial_format(@too_short, { count: @minimum })
+  elsif @is && length != @is
+    partial_format(@wrong_length, { count: @is })
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Validator/NumericalityValidator.html b/api-doc/2.1.6/GraphQL/Schema/Validator/NumericalityValidator.html new file mode 100644 index 0000000000..1fa560cfd8 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Validator/NumericalityValidator.html @@ -0,0 +1,548 @@ + + + + + + + Class: GraphQL::Schema::Validator::NumericalityValidator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Validator::NumericalityValidator + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Validator + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/validator/numericality_validator.rb
+
+ +
+ +

Overview

+
+

Use this to assert numerical comparisons hold true for inputs.

+ + +
+
+
+ +
+

Examples:

+ + +

Require a number between 0 and 1

+

+ +

+argument :batting_average, Float, required: true, validates: { numericality: { within: 0..1 } }
+ + +

Require the number 42

+

+ +

+argument :the_answer, Integer, required: true, validates: { numericality: { equal_to: 42 } }
+ + +

Require a real number

+

+ +

+argument :items_count, Integer, required: true, validates: { numericality: { greater_than_or_equal_to: 0 } }
+ +
+ + +
+ + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Validator

+

#validated

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Validator

+

from_config, install, #partial_format, #permitted_empty_value?, uninstall, validate!

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(greater_than: nil, greater_than_or_equal_to: nil, less_than: nil, less_than_or_equal_to: nil, equal_to: nil, other_than: nil, odd: nil, even: nil, within: nil, message: "%{validated} must be %{comparison} %{target}", null_message: Validator::AllowNullValidator::MESSAGE, **default_options) ⇒ NumericalityValidator + + + + + +

+
+

Returns a new instance of NumericalityValidator.

+ + +
+
+
+

Parameters:

+
    + +
  • + + greater_than + + + (Integer) + + + (defaults to: nil) + + +
  • + +
  • + + greater_than_or_equal_to + + + (Integer) + + + (defaults to: nil) + + +
  • + +
  • + + less_than + + + (Integer) + + + (defaults to: nil) + + +
  • + +
  • + + less_than_or_equal_to + + + (Integer) + + + (defaults to: nil) + + +
  • + +
  • + + equal_to + + + (Integer) + + + (defaults to: nil) + + +
  • + +
  • + + other_than + + + (Integer) + + + (defaults to: nil) + + +
  • + +
  • + + odd + + + (Boolean) + + + (defaults to: nil) + + +
  • + +
  • + + even + + + (Boolean) + + + (defaults to: nil) + + +
  • + +
  • + + within + + + (Range) + + + (defaults to: nil) + + +
  • + +
  • + + message + + + (String) + + + (defaults to: "%{validated} must be %{comparison} %{target}") + + + — +

    used for all validation failures

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
+
# File 'lib/graphql/schema/validator/numericality_validator.rb', line 30
+
+def initialize(
+    greater_than: nil, greater_than_or_equal_to: nil,
+    less_than: nil, less_than_or_equal_to: nil,
+    equal_to: nil, other_than: nil,
+    odd: nil, even: nil, within: nil,
+    message: "%{validated} must be %{comparison} %{target}",
+    null_message: Validator::AllowNullValidator::MESSAGE,
+    **default_options
+  )
+
+  @greater_than = greater_than
+  @greater_than_or_equal_to = greater_than_or_equal_to
+  @less_than = less_than
+  @less_than_or_equal_to = less_than_or_equal_to
+  @equal_to = equal_to
+  @other_than = other_than
+  @odd = odd
+  @even = even
+  @within = within
+  @message = message
+  @null_message = null_message
+  super(**default_options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #validate(object, context, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+
+
# File 'lib/graphql/schema/validator/numericality_validator.rb', line 54
+
+def validate(object, context, value)
+  if permitted_empty_value?(value)
+    # pass in this case
+  elsif value.nil? # @allow_null is handled in the parent class
+    @null_message
+  elsif @greater_than && value <= @greater_than
+    partial_format(@message, { comparison: "greater than", target: @greater_than })
+  elsif @greater_than_or_equal_to && value < @greater_than_or_equal_to
+    partial_format(@message, { comparison: "greater than or equal to", target: @greater_than_or_equal_to })
+  elsif @less_than && value >= @less_than
+    partial_format(@message, { comparison: "less than", target: @less_than })
+  elsif @less_than_or_equal_to && value > @less_than_or_equal_to
+    partial_format(@message, { comparison: "less than or equal to", target: @less_than_or_equal_to })
+  elsif @equal_to && value != @equal_to
+    partial_format(@message, { comparison: "equal to", target: @equal_to })
+  elsif @other_than && value == @other_than
+    partial_format(@message, { comparison: "something other than", target: @other_than })
+  elsif @even && !value.even?
+    (partial_format(@message, { comparison: "even", target: "" })).strip
+  elsif @odd && !value.odd?
+    (partial_format(@message, { comparison: "odd", target: "" })).strip
+  elsif @within && !@within.include?(value)
+    partial_format(@message, { comparison: "within", target: @within })
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Validator/RequiredValidator.html b/api-doc/2.1.6/GraphQL/Schema/Validator/RequiredValidator.html new file mode 100644 index 0000000000..853a796f1a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Validator/RequiredValidator.html @@ -0,0 +1,441 @@ + + + + + + + Class: GraphQL::Schema::Validator::RequiredValidator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Validator::RequiredValidator + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::Validator + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/validator/required_validator.rb
+
+ +
+ +

Overview

+
+

Use this validator to require one of the named arguments to be present. +Or, use Arrays of symbols to name a valid set of arguments.

+ +

(This is for specifying mutually exclusive sets of arguments.)

+ + +
+
+
+ +
+

Examples:

+ + +

Require exactly one of these arguments

+

+ +

+field :update_amount, IngredientAmount, null: false do
+  argument :ingredient_id, ID, required: true
+  argument :cups, Integer, required: false
+  argument :tablespoons, Integer, required: false
+  argument :teaspoons, Integer, required: false
+  validates required: { one_of: [:cups, :tablespoons, :teaspoons] }
+end
+ + +

Require one of these sets of arguments

+

+ +

+field :find_object, Node, null: true do
+  argument :node_id, ID, required: false
+  argument :object_type, String, required: false
+  argument :object_id, Integer, required: false
+  # either a global `node_id` or an `object_type`/`object_id` pair is required:
+  validates required: { one_of: [:node_id, [:object_type, :object_id]] }
+end
+ + +

require some value for an argument, even if it’s null

+

+ +
field :update_settings, AccountSettings do
+  # `required: :nullable` means this argument must be given, but may be `null`
+  argument :age, Integer, required: :nullable
+end
+ +
+ + +
+ + +

Constant Summary

+ +

Constants included + from EmptyObjects

+

EmptyObjects::EMPTY_ARRAY, EmptyObjects::EMPTY_HASH

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::Validator

+

#validated

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::Validator

+

from_config, install, #partial_format, #permitted_empty_value?, uninstall, validate!

+ + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(one_of: nil, argument: nil, message: "%{validated} has the wrong arguments", **default_options) ⇒ RequiredValidator + + + + + +

+
+

Returns a new instance of RequiredValidator.

+ + +
+
+
+

Parameters:

+
    + +
  • + + one_of + + + (Symbol, Array<Symbol>) + + + (defaults to: nil) + + + — +

    An argument, or a list of arguments, that represents a valid set of inputs for this field

    +
    + +
  • + +
  • + + message + + + (String) + + + (defaults to: "%{validated} has the wrong arguments") + + +
  • + +
+ + +
+ + + + +
+
+
+
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
+
# File 'lib/graphql/schema/validator/required_validator.rb', line 40
+
+def initialize(one_of: nil, argument: nil, message: "%{validated} has the wrong arguments", **default_options)
+  @one_of = if one_of
+    one_of
+  elsif argument
+    [argument]
+  else
+    raise ArgumentError, "`one_of:` or `argument:` must be given in `validates required: {...}`"
+  end
+  @message = message
+  super(**default_options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #validate(_object, _context, value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+
+
# File 'lib/graphql/schema/validator/required_validator.rb', line 52
+
+def validate(_object, _context, value)
+  matched_conditions = 0
+
+  if !value.nil?
+    @one_of.each do |one_of_condition|
+      case one_of_condition
+      when Symbol
+        if value.key?(one_of_condition)
+          matched_conditions += 1
+        end
+      when Array
+        if one_of_condition.all? { |k| value.key?(k) }
+          matched_conditions += 1
+          break
+        end
+      else
+        raise ArgumentError, "Unknown one_of condition: #{one_of_condition.inspect}"
+      end
+    end
+  end
+
+  if matched_conditions == 1
+    nil # OK
+  else
+    @message
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Validator/ValidationFailedError.html b/api-doc/2.1.6/GraphQL/Schema/Validator/ValidationFailedError.html new file mode 100644 index 0000000000..22b069d79e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Validator/ValidationFailedError.html @@ -0,0 +1,312 @@ + + + + + + + Exception: GraphQL::Schema::Validator::ValidationFailedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Schema::Validator::ValidationFailedError + + + +

+
+ +
+
Inherits:
+
+ ExecutionError + +
    +
  • Object
  • + + + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/validator.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #errors ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute errors.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from ExecutionError

+

#ast_node, #extensions, #options, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from ExecutionError

+

#to_h

+ + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(errors:) ⇒ ValidationFailedError + + + + + +

+
+

Returns a new instance of ValidationFailedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+110
+111
+112
+113
+
+
# File 'lib/graphql/schema/validator.rb', line 110
+
+def initialize(errors:)
+  @errors = errors
+  super(errors.join(", "))
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #errorsObject (readonly) + + + + + +

+
+

Returns the value of attribute errors.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+108
+109
+110
+
+
# File 'lib/graphql/schema/validator.rb', line 108
+
+def errors
+  @errors
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Warden.html b/api-doc/2.1.6/GraphQL/Schema/Warden.html new file mode 100644 index 0000000000..d66bcfa053 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Warden.html @@ -0,0 +1,2382 @@ + + + + + + + Class: GraphQL::Schema::Warden + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Warden + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/warden.rb
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

Restrict access to a GraphQL::Schema with a user-defined visible? implementations.

+ +

When validating and executing a query, all access to schema members +should go through a warden. If you access the schema directly, +you may show a client something that it shouldn’t be allowed to see.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: NullWarden, PassThruWarden + + +

+ + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(context:, schema:) ⇒ Warden + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of Warden.

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+
+
# File 'lib/graphql/schema/warden.rb', line 96
+
+def initialize(context:, schema:)
+  @schema = schema
+  # Cache these to avoid repeated hits to the inheritance chain when one isn't present
+  @query = @schema.query
+  @mutation = @schema.mutation
+  @subscription = @schema.subscription
+  @context = context
+  @visibility_cache = read_through { |m| schema.visible?(m, context) }
+  @visibility_cache.compare_by_identity
+  # Initialize all ivars to improve object shape consistency:
+  @types = @visible_types = @reachable_types = @visible_parent_fields =
+    @visible_possible_types = @visible_fields = @visible_arguments = @visible_enum_arrays =
+    @visible_enum_values = @visible_interfaces = @type_visibility = @type_memberships =
+    @visible_and_reachable_type = @unions = @unfiltered_interfaces =
+    @reachable_type_set =
+      nil
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .from_context(context) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+
+
# File 'lib/graphql/schema/warden.rb', line 15
+
+def self.from_context(context)
+  context.warden || PassThruWarden
+rescue NoMethodError
+  # this might be a hash which won't respond to #warden
+  PassThruWarden
+end
+
+
+ +
+

+ + .visible_entry?(visibility_method, entry, context, warden = Warden.from_context(context)) ⇒ Object? + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+

Parameters:

+
    + +
  • + + visibility_method + + + (Symbol) + + + + — +

    a Warden method to call for this entry

    +
    + +
  • + +
  • + + entry + + + (Object, Array<Object>) + + + + — +

    One or more definitions for a given name in a GraphQL Schema

    +
    + +
  • + +
  • + + context + + + (GraphQL::Query::Context) + + + +
  • + +
  • + + warden + + + (Warden) + + + (defaults to: Warden.from_context(context)) + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    entry or one of entry’s items if exactly one of them is visible for this context

    +
    + +
  • + +
  • + + + (nil) + + + + — +

    If neither entry nor any of entry’s items are visible for this context

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+
+
# File 'lib/graphql/schema/warden.rb', line 28
+
+def self.visible_entry?(visibility_method, entry, context, warden = Warden.from_context(context))
+  if entry.is_a?(Array)
+    visible_item = nil
+    entry.each do |item|
+      if warden.public_send(visibility_method, item, context)
+        if visible_item.nil?
+          visible_item = item
+        else
+          raise DuplicateNamesError.new(
+            duplicated_name: item.path, duplicated_definition_1: visible_item.inspect, duplicated_definition_2: item.inspect
+          )
+        end
+      end
+    end
+    visible_item
+  elsif warden.public_send(visibility_method, entry, context)
+    entry
+  else
+    nil
+  end
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #arguments(argument_owner, ctx = nil) ⇒ Array<GraphQL::Argument> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Visible arguments on argument_owner.

+ + +
+
+
+

Parameters:

+
    + +
  • + + argument_owner + + + (GraphQL::Field, GraphQL::InputObjectType) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array<GraphQL::Argument>) + + + + — +

    Visible arguments on argument_owner

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+
+
# File 'lib/graphql/schema/warden.rb', line 197
+
+def arguments(argument_owner, ctx = nil)
+  @visible_arguments ||= read_through { |o|
+    args = o.arguments(@context)
+    if args.any?
+      args = args.values
+      args.select! { |a| visible_argument?(a, @context) }
+      args
+    else
+      EmptyObjects::EMPTY_ARRAY
+    end
+  }
+  @visible_arguments[argument_owner]
+end
+
+
+ +
+

+ + #directivesObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+240
+241
+242
+
+
# File 'lib/graphql/schema/warden.rb', line 240
+
+def directives
+  @schema.directives.each_value.select { |d| visible?(d) }
+end
+
+
+ +
+

+ + #enum_values(enum_defn) ⇒ Array<GraphQL::EnumType::EnumValue> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Visible members of enum_defn.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<GraphQL::EnumType::EnumValue>) + + + + — +

    Visible members of enum_defn

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+
+
# File 'lib/graphql/schema/warden.rb', line 212
+
+def enum_values(enum_defn)
+  @visible_enum_arrays ||= read_through { |e|
+    values = e.enum_values(@context)
+    if values.size == 0
+      raise GraphQL::Schema::Enum::MissingValuesError.new(e)
+    end
+    values
+  }
+  @visible_enum_arrays[enum_defn]
+end
+
+
+ +
+

+ + #fields(type_defn) ⇒ Array<GraphQL::Field> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Fields on type_defn.

+ + +
+
+
+

Parameters:

+
    + +
  • + + type_defn + + + (GraphQL::ObjectType, GraphQL::InterfaceType) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array<GraphQL::Field>) + + + + — +

    Fields on type_defn

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+190
+191
+192
+193
+
+
# File 'lib/graphql/schema/warden.rb', line 190
+
+def fields(type_defn)
+  @visible_fields ||= read_through { |t| @schema.get_fields(t, @context).values }
+  @visible_fields[type_defn]
+end
+
+
+ +
+

+ + #get_argument(parent_type, argument_name) ⇒ GraphQL::Argument? + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns The argument named argument_name on parent_type, if it exists and is visible.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Argument, nil) + + + + — +

    The argument named argument_name on parent_type, if it exists and is visible

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+174
+175
+176
+177
+
+
# File 'lib/graphql/schema/warden.rb', line 174
+
+def get_argument(parent_type, argument_name)
+  argument = parent_type.get_argument(argument_name, @context)
+  return argument if argument && visible_argument?(argument, @context)
+end
+
+
+ +
+

+ + #get_field(parent_type, field_name) ⇒ GraphQL::Field? + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns The field named field_name on parent_type, if it exists.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Field, nil) + + + + — +

    The field named field_name on parent_type, if it exists

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+
+
# File 'lib/graphql/schema/warden.rb', line 158
+
+def get_field(parent_type, field_name)
+  @visible_parent_fields ||= read_through do |type|
+    read_through do |f_name|
+      field_defn = @schema.get_field(type, f_name, @context)
+      if field_defn && visible_field?(field_defn, nil, type)
+        field_defn
+      else
+        nil
+      end
+    end
+  end
+
+  @visible_parent_fields[parent_type][field_name]
+end
+
+
+ +
+

+ + #get_type(type_name) ⇒ GraphQL::BaseType? + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns The type named type_name, if it exists (else nil).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::BaseType, nil) + + + + — +

    The type named type_name, if it exists (else nil)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+
+
# File 'lib/graphql/schema/warden.rb', line 133
+
+def get_type(type_name)
+  @visible_types ||= read_through do |name|
+    type_defn = @schema.get_type(name, @context)
+    if type_defn && visible_and_reachable_type?(type_defn)
+      type_defn
+    else
+      nil
+    end
+  end
+
+  @visible_types[type_name]
+end
+
+
+ +
+

+ + #interface_type_memberships(obj_type, _ctx = nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+277
+278
+279
+280
+281
+282
+
+
# File 'lib/graphql/schema/warden.rb', line 277
+
+def interface_type_memberships(obj_type, _ctx = nil)
+  @type_memberships ||= read_through do |obj_t|
+    obj_t.interface_type_memberships
+  end
+  @type_memberships[obj_type]
+end
+
+
+ +
+

+ + #interfaces(obj_type) ⇒ Array<GraphQL::InterfaceType> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Visible interfaces implemented by obj_type.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<GraphQL::InterfaceType>) + + + + — +

    Visible interfaces implemented by obj_type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+
+
# File 'lib/graphql/schema/warden.rb', line 229
+
+def interfaces(obj_type)
+  @visible_interfaces ||= read_through { |t|
+    ints = t.interfaces(@context)
+    if ints.any?
+      ints.select! { |i| visible_type?(i) }
+    end
+    ints
+  }
+  @visible_interfaces[obj_type]
+end
+
+
+ +
+

+ + #loadable?(type, _ctx) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns True if this type is used for loads: but not in the schema otherwise and not explicitly hidden.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    True if this type is used for loads: but not in the schema otherwise and not explicitly hidden.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+128
+129
+130
+
+
# File 'lib/graphql/schema/warden.rb', line 128
+
+def loadable?(type, _ctx)
+  !reachable_type_set.include?(type) && visible_type?(type)
+end
+
+
+ +
+

+ + #possible_types(type_defn) ⇒ Array<GraphQL::BaseType> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns The types which may be member of type_defn.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<GraphQL::BaseType>) + + + + — +

    The types which may be member of type_defn

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+180
+181
+182
+183
+184
+185
+186
+
+
# File 'lib/graphql/schema/warden.rb', line 180
+
+def possible_types(type_defn)
+  @visible_possible_types ||= read_through { |type_defn|
+    pt = @schema.possible_types(type_defn, @context)
+    pt.select { |t| visible_and_reachable_type?(t) }
+  }
+  @visible_possible_types[type_defn]
+end
+
+
+ +
+

+ + #reachable_type?(type_name) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Boolean True if the type is visible and reachable in the schema.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Boolean True if the type is visible and reachable in the schema

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+152
+153
+154
+155
+
+
# File 'lib/graphql/schema/warden.rb', line 152
+
+def reachable_type?(type_name)
+  type = get_type(type_name) # rubocop:disable Development/ContextIsPassedCop -- `self` is query-aware
+  type && reachable_type_set.include?(type)
+end
+
+
+ +
+

+ + #reachable_typesArray<GraphQL::BaseType> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Visible and reachable types in the schema.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<GraphQL::BaseType>) + + + + — +

    Visible and reachable types in the schema

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+147
+148
+149
+
+
# File 'lib/graphql/schema/warden.rb', line 147
+
+def reachable_types
+  @reachable_types ||= reachable_type_set.to_a
+end
+
+
+ +
+

+ + #root_type_for_operation(op_name) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+244
+245
+246
+247
+248
+249
+250
+251
+
+
# File 'lib/graphql/schema/warden.rb', line 244
+
+def root_type_for_operation(op_name)
+  root_type = @schema.root_type_for_operation(op_name)
+  if root_type && visible?(root_type)
+    root_type
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + #typesHash<String, GraphQL::BaseType> + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Visible types in the schema.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Hash<String, GraphQL::BaseType>) + + + + — +

    Visible types in the schema

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+
+
# File 'lib/graphql/schema/warden.rb', line 115
+
+def types
+  @types ||= begin
+    vis_types = {}
+    @schema.types(@context).each do |n, t|
+      if visible_and_reachable_type?(t)
+        vis_types[n] = t
+      end
+    end
+    vis_types
+  end
+end
+
+
+ +
+

+ + #visible_argument?(arg_defn, _ctx = nil) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+264
+265
+266
+
+
# File 'lib/graphql/schema/warden.rb', line 264
+
+def visible_argument?(arg_defn, _ctx = nil)
+  visible?(arg_defn) && visible_and_reachable_type?(arg_defn.type.unwrap)
+end
+
+
+ +
+

+ + #visible_enum_value?(enum_value, _ctx = nil) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+223
+224
+225
+226
+
+
# File 'lib/graphql/schema/warden.rb', line 223
+
+def visible_enum_value?(enum_value, _ctx = nil)
+  @visible_enum_values ||= read_through { |ev| visible?(ev) }
+  @visible_enum_values[enum_value]
+end
+
+
+ +
+

+ + #visible_field?(field_defn, _ctx = nil, owner = field_defn.owner) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+

Parameters:

+
    + +
  • + + owner + + + (Class, Module) + + + (defaults to: field_defn.owner) + + + — +

    If provided, confirm that field has the given owner.

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+254
+255
+256
+257
+258
+259
+260
+261
+262
+
+
# File 'lib/graphql/schema/warden.rb', line 254
+
+def visible_field?(field_defn, _ctx = nil, owner = field_defn.owner)
+  # This field is visible in its own right
+  visible?(field_defn) &&
+    # This field's return type is visible
+    visible_and_reachable_type?(field_defn.type.unwrap) &&
+    # This field is either defined on this object type,
+    # or the interface it's inherited from is also visible
+    ((field_defn.respond_to?(:owner) && field_defn.owner == owner) || field_on_visible_interface?(field_defn, owner))
+end
+
+
+ +
+

+ + #visible_type?(type_defn, _ctx = nil) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+268
+269
+270
+271
+
+
# File 'lib/graphql/schema/warden.rb', line 268
+
+def visible_type?(type_defn, _ctx = nil)
+  @type_visibility ||= read_through { |type_defn| visible?(type_defn) }
+  @type_visibility[type_defn]
+end
+
+
+ +
+

+ + #visible_type_membership?(type_membership, _ctx = nil) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+273
+274
+275
+
+
# File 'lib/graphql/schema/warden.rb', line 273
+
+def visible_type_membership?(type_membership, _ctx = nil)
+  visible?(type_membership)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Warden/NullWarden.html b/api-doc/2.1.6/GraphQL/Schema/Warden/NullWarden.html new file mode 100644 index 0000000000..2a2501648b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Warden/NullWarden.html @@ -0,0 +1,1576 @@ + + + + + + + Class: GraphQL::Schema::Warden::NullWarden + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Warden::NullWarden + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/warden.rb
+
+ +
+ +
+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(_filter = nil, context:, schema:) ⇒ NullWarden + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of NullWarden.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+68
+69
+70
+
+
# File 'lib/graphql/schema/warden.rb', line 68
+
+def initialize(_filter = nil, context:, schema:)
+  @schema = schema
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #arguments(argument_owner, ctx = nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+79
+
+
# File 'lib/graphql/schema/warden.rb', line 79
+
+def arguments(argument_owner, ctx = nil); argument_owner.all_argument_definitions; end
+
+
+ +
+

+ + #directivesObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+84
+
+
# File 'lib/graphql/schema/warden.rb', line 84
+
+def directives; @schema.directives.values; end
+
+
+ +
+

+ + #enum_values(enum_defn) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

rubocop:disable Development/ContextIsPassedCop

+ + +
+
+
+ + +
+ + + + +
+
+
+
+80
+
+
# File 'lib/graphql/schema/warden.rb', line 80
+
+def enum_values(enum_defn); enum_defn.enum_values; end
+
+
+ +
+

+ + #fields(type_defn) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

rubocop:disable Development/ContextIsPassedCop

+ + +
+
+
+ + +
+ + + + +
+
+
+
+85
+
+
# File 'lib/graphql/schema/warden.rb', line 85
+
+def fields(type_defn); type_defn.all_field_definitions; end
+
+
+ +
+

+ + #get_argument(parent_type, argument_name) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

rubocop:disable Development/ContextIsPassedCop

+ + +
+
+
+ + +
+ + + + +
+
+
+
+81
+
+
# File 'lib/graphql/schema/warden.rb', line 81
+
+def get_argument(parent_type, argument_name); parent_type.get_argument(argument_name); end
+
+
+ +
+

+ + #get_field(parent_type, field_name) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+86
+
+
# File 'lib/graphql/schema/warden.rb', line 86
+
+def get_field(parent_type, field_name); @schema.get_field(parent_type, field_name); end
+
+
+ +
+

+ + #get_type(type_name) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

rubocop:disable Development/ContextIsPassedCop

+ + +
+
+
+ + +
+ + + + +
+
+
+
+78
+
+
# File 'lib/graphql/schema/warden.rb', line 78
+
+def get_type(type_name); @schema.get_type(type_name); end
+
+
+ +
+

+ + #interface_type_memberships(obj_type, _ctx = nil) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+77
+
+
# File 'lib/graphql/schema/warden.rb', line 77
+
+def interface_type_memberships(obj_type, _ctx = nil); obj_type.interface_type_memberships; end
+
+
+ +
+

+ + #interfaces(obj_type) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+91
+
+
# File 'lib/graphql/schema/warden.rb', line 91
+
+def interfaces(obj_type); obj_type.interfaces; end
+
+
+ +
+

+ + #loadable?(type, _ctx) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+88
+
+
# File 'lib/graphql/schema/warden.rb', line 88
+
+def loadable?(type, _ctx); true; end
+
+
+ +
+

+ + #possible_types(type_defn) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+90
+
+
# File 'lib/graphql/schema/warden.rb', line 90
+
+def possible_types(type_defn); @schema.possible_types(type_defn); end
+
+
+ +
+

+ + #reachable_type?(type_name) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+87
+
+
# File 'lib/graphql/schema/warden.rb', line 87
+
+def reachable_type?(type_name); true; end
+
+
+ +
+

+ + #reachable_typesObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

rubocop:disable Development/ContextIsPassedCop

+ + +
+
+
+ + +
+ + + + +
+
+
+
+89
+
+
# File 'lib/graphql/schema/warden.rb', line 89
+
+def reachable_types; @schema.types.values; end
+
+
+ +
+

+ + #root_type_for_operation(op_name) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+83
+
+
# File 'lib/graphql/schema/warden.rb', line 83
+
+def root_type_for_operation(op_name); @schema.root_type_for_operation(op_name); end
+
+
+ +
+

+ + #typesObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

rubocop:disable Development/ContextIsPassedCop

+ + +
+
+
+ + +
+ + + + +
+
+
+
+82
+
+
# File 'lib/graphql/schema/warden.rb', line 82
+
+def types; @schema.types; end
+
+
+ +
+

+ + #visible_argument?(arg_defn, _ctx = nil) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+73
+
+
# File 'lib/graphql/schema/warden.rb', line 73
+
+def visible_argument?(arg_defn, _ctx = nil); true; end
+
+
+ +
+

+ + #visible_enum_value?(enum_value, _ctx = nil) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+75
+
+
# File 'lib/graphql/schema/warden.rb', line 75
+
+def visible_enum_value?(enum_value, _ctx = nil); true; end
+
+
+ +
+

+ + #visible_field?(field_defn, _ctx = nil, owner = nil) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+72
+
+
# File 'lib/graphql/schema/warden.rb', line 72
+
+def visible_field?(field_defn, _ctx = nil, owner = nil); true; end
+
+
+ +
+

+ + #visible_type?(type_defn, _ctx = nil) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+74
+
+
# File 'lib/graphql/schema/warden.rb', line 74
+
+def visible_type?(type_defn, _ctx = nil); true; end
+
+
+ +
+

+ + #visible_type_membership?(type_membership, _ctx = nil) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+76
+
+
# File 'lib/graphql/schema/warden.rb', line 76
+
+def visible_type_membership?(type_membership, _ctx = nil); true; end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Warden/PassThruWarden.html b/api-doc/2.1.6/GraphQL/Schema/Warden/PassThruWarden.html new file mode 100644 index 0000000000..7b60912a9c --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Warden/PassThruWarden.html @@ -0,0 +1,737 @@ + + + + + + + Class: GraphQL::Schema::Warden::PassThruWarden + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Warden::PassThruWarden + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/schema/warden.rb
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

This is used when a caller provides a Hash for context. +We want to call the schema’s hooks, but we don’t have a full-blown warden. +The context arguments to these methods exist purely to simplify the code that +calls methods on this object, so it will have everything it needs.

+ + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .arguments(owner, ctx) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+62
+
+
# File 'lib/graphql/schema/warden.rb', line 62
+
+def arguments(owner, ctx); owner.arguments(ctx); end
+
+
+ +
+

+ + .interface_type_memberships(obj_t, ctx) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+61
+
+
# File 'lib/graphql/schema/warden.rb', line 61
+
+def interface_type_memberships(obj_t, ctx); obj_t.interface_type_memberships; end
+
+
+ +
+

+ + .loadable?(type, ctx) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+63
+
+
# File 'lib/graphql/schema/warden.rb', line 63
+
+def loadable?(type, ctx); type.visible?(ctx); end
+
+
+ +
+

+ + .visible_argument?(arg, ctx) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+57
+
+
# File 'lib/graphql/schema/warden.rb', line 57
+
+def visible_argument?(arg, ctx); arg.visible?(ctx); end
+
+
+ +
+

+ + .visible_enum_value?(ev, ctx) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+59
+
+
# File 'lib/graphql/schema/warden.rb', line 59
+
+def visible_enum_value?(ev, ctx); ev.visible?(ctx); end
+
+
+ +
+

+ + .visible_field?(field, ctx) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+56
+
+
# File 'lib/graphql/schema/warden.rb', line 56
+
+def visible_field?(field, ctx); field.visible?(ctx); end
+
+
+ +
+

+ + .visible_type?(type, ctx) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+58
+
+
# File 'lib/graphql/schema/warden.rb', line 58
+
+def visible_type?(type, ctx); type.visible?(ctx); end
+
+
+ +
+

+ + .visible_type_membership?(tm, ctx) ⇒ Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+60
+
+
# File 'lib/graphql/schema/warden.rb', line 60
+
+def visible_type_membership?(tm, ctx); tm.visible?(ctx); end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Schema/Wrapper.html b/api-doc/2.1.6/GraphQL/Schema/Wrapper.html new file mode 100644 index 0000000000..eef4312743 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Schema/Wrapper.html @@ -0,0 +1,430 @@ + + + + + + + Class: GraphQL::Schema::Wrapper + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Schema::Wrapper + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Member::TypeSystemHelpers
+
+ + + + + + +
+
Defined in:
+
lib/graphql/schema/wrapper.rb
+
+ +
+ +
+

Direct Known Subclasses

+

List, NonNull

+
+ + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #of_type ⇒ Class, Module + + + + + + + + + readonly + + + + + + + + + +

    The inner type of this wrapping type, the type of which one or more objects may be present.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Member::TypeSystemHelpers

+

#kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+
+

Constructor Details

+ +
+

+ + #initialize(of_type) ⇒ Wrapper + + + + + +

+
+

Returns a new instance of Wrapper.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'lib/graphql/schema/wrapper.rb', line 11
+
+def initialize(of_type)
+  @of_type = of_type
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #of_typeClass, Module (readonly) + + + + + +

+
+

Returns The inner type of this wrapping type, the type of which one or more objects may be present.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class, Module) + + + + — +

    The inner type of this wrapping type, the type of which one or more objects may be present.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/schema/wrapper.rb', line 9
+
+def of_type
+  @of_type
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #==(other) ⇒ Object + + + + + +

+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/schema/wrapper.rb', line 19
+
+def ==(other)
+  self.class == other.class && of_type == other.of_type
+end
+
+
+ +
+

+ + #unwrapObject + + + + + +

+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/schema/wrapper.rb', line 15
+
+def unwrap
+  @of_type.unwrap
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation.html b/api-doc/2.1.6/GraphQL/StaticValidation.html new file mode 100644 index 0000000000..ba8096521a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation.html @@ -0,0 +1,180 @@ + + + + + + + Module: GraphQL::StaticValidation + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/error.rb,
+ lib/graphql/static_validation/all_rules.rb,
lib/graphql/static_validation/validator.rb,
lib/graphql/static_validation/base_visitor.rb,
lib/graphql/static_validation/literal_validator.rb,
lib/graphql/static_validation/validation_context.rb,
lib/graphql/static_validation/interpreter_visitor.rb,
lib/graphql/static_validation/definition_dependencies.rb,
lib/graphql/static_validation/rules/fields_will_merge.rb,
lib/graphql/static_validation/rules/query_root_exists.rb,
lib/graphql/static_validation/rules/fragments_are_used.rb,
lib/graphql/static_validation/validation_timeout_error.rb,
lib/graphql/static_validation/rules/fragments_are_named.rb,
lib/graphql/static_validation/rules/fragment_types_exist.rb,
lib/graphql/static_validation/rules/fragments_are_finite.rb,
lib/graphql/static_validation/rules/mutation_root_exists.rb,
lib/graphql/static_validation/rules/arguments_are_defined.rb,
lib/graphql/static_validation/rules/directives_are_defined.rb,
lib/graphql/static_validation/rules/fields_will_merge_error.rb,
lib/graphql/static_validation/rules/query_root_exists_error.rb,
lib/graphql/static_validation/rules/fragments_are_used_error.rb,
lib/graphql/static_validation/rules/subscription_root_exists.rb,
lib/graphql/static_validation/rules/argument_names_are_unique.rb,
lib/graphql/static_validation/rules/fragment_names_are_unique.rb,
lib/graphql/static_validation/rules/fragments_are_named_error.rb,
lib/graphql/static_validation/rules/operation_names_are_valid.rb,
lib/graphql/static_validation/rules/variable_names_are_unique.rb,
lib/graphql/static_validation/rules/variables_are_input_types.rb,
lib/graphql/static_validation/rules/fields_are_defined_on_type.rb,
lib/graphql/static_validation/rules/fragment_types_exist_error.rb,
lib/graphql/static_validation/rules/fragments_are_finite_error.rb,
lib/graphql/static_validation/rules/mutation_root_exists_error.rb,
lib/graphql/static_validation/rules/no_definitions_are_present.rb,
lib/graphql/static_validation/rules/arguments_are_defined_error.rb,
lib/graphql/static_validation/rules/variable_usages_are_allowed.rb,
lib/graphql/static_validation/rules/directives_are_defined_error.rb,
lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb,
lib/graphql/static_validation/rules/input_object_names_are_unique.rb,
lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb,
lib/graphql/static_validation/rules/required_arguments_are_present.rb,
lib/graphql/static_validation/rules/subscription_root_exists_error.rb,
lib/graphql/static_validation/rules/unique_directives_per_location.rb,
lib/graphql/static_validation/rules/variables_are_used_and_defined.rb,
lib/graphql/static_validation/rules/argument_names_are_unique_error.rb,
lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb,
lib/graphql/static_validation/rules/operation_names_are_valid_error.rb,
lib/graphql/static_validation/rules/variable_names_are_unique_error.rb,
lib/graphql/static_validation/rules/variables_are_input_types_error.rb,
lib/graphql/static_validation/rules/argument_literals_are_compatible.rb,
lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb,
lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb,
lib/graphql/static_validation/rules/no_definitions_are_present_error.rb,
lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb,
lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb,
lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb,
lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb,
lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb,
lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb,
lib/graphql/static_validation/rules/required_arguments_are_present_error.rb,
lib/graphql/static_validation/rules/unique_directives_per_location_error.rb,
lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb,
lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb,
lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb,
lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb,
lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb,
lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb,
lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb,
lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb,
lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: ArgumentLiteralsAreCompatible, ArgumentNamesAreUnique, ArgumentsAreDefined, DefinitionDependencies, DirectivesAreDefined, DirectivesAreInValidLocations, FieldsAreDefinedOnType, FieldsHaveAppropriateSelections, FieldsWillMerge, FragmentNamesAreUnique, FragmentSpreadsArePossible, FragmentTypesExist, FragmentsAreFinite, FragmentsAreNamed, FragmentsAreOnCompositeTypes, FragmentsAreUsed, InputObjectNamesAreUnique, MutationRootExists, NoDefinitionsArePresent, OneOfInputObjectsAreValid, OperationNamesAreValid, QueryRootExists, RequiredArgumentsArePresent, RequiredInputObjectAttributesArePresent, SubscriptionRootExists, UniqueDirectivesPerLocation, VariableDefaultValuesAreCorrectlyTyped, VariableNamesAreUnique, VariableUsagesAreAllowed, VariablesAreInputTypes, VariablesAreUsedAndDefined + + + + Classes: ArgumentLiteralsAreCompatibleError, ArgumentNamesAreUniqueError, ArgumentsAreDefinedError, BaseVisitor, DirectivesAreDefinedError, DirectivesAreInValidLocationsError, Error, FieldsAreDefinedOnTypeError, FieldsHaveAppropriateSelectionsError, FieldsWillMergeError, FragmentNamesAreUniqueError, FragmentSpreadsArePossibleError, FragmentTypesExistError, FragmentsAreFiniteError, FragmentsAreNamedError, FragmentsAreOnCompositeTypesError, FragmentsAreUsedError, InputObjectNamesAreUniqueError, InterpreterVisitor, LiteralValidator, MutationRootExistsError, NoDefinitionsArePresentError, OneOfInputObjectsAreValidError, OperationNamesAreValidError, QueryRootExistsError, RequiredArgumentsArePresentError, RequiredInputObjectAttributesArePresentError, SubscriptionRootExistsError, UniqueDirectivesPerLocationError, ValidationContext, ValidationTimeoutError, Validator, VariableDefaultValuesAreCorrectlyTypedError, VariableNamesAreUniqueError, VariableUsagesAreAllowedError, VariablesAreInputTypesError, VariablesAreUsedAndDefinedError + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
ALL_RULES = +
+
+

Default rules for Validator

+ +

Order is important here. Some validators skip later hooks. +which stops the visit on that node. That way it doesn’t try to find fields on types that +don’t exist, etc.

+ + +
+
+
+ + +
+
+
[
+  GraphQL::StaticValidation::NoDefinitionsArePresent,
+  GraphQL::StaticValidation::DirectivesAreDefined,
+  GraphQL::StaticValidation::DirectivesAreInValidLocations,
+  GraphQL::StaticValidation::UniqueDirectivesPerLocation,
+  GraphQL::StaticValidation::OperationNamesAreValid,
+  GraphQL::StaticValidation::FragmentNamesAreUnique,
+  GraphQL::StaticValidation::FragmentsAreFinite,
+  GraphQL::StaticValidation::FragmentsAreNamed,
+  GraphQL::StaticValidation::FragmentsAreUsed,
+  GraphQL::StaticValidation::FragmentTypesExist,
+  GraphQL::StaticValidation::FragmentsAreOnCompositeTypes,
+  GraphQL::StaticValidation::FragmentSpreadsArePossible,
+  GraphQL::StaticValidation::FieldsAreDefinedOnType,
+  GraphQL::StaticValidation::FieldsWillMerge,
+  GraphQL::StaticValidation::FieldsHaveAppropriateSelections,
+  GraphQL::StaticValidation::ArgumentsAreDefined,
+  GraphQL::StaticValidation::ArgumentLiteralsAreCompatible,
+  GraphQL::StaticValidation::RequiredArgumentsArePresent,
+  GraphQL::StaticValidation::RequiredInputObjectAttributesArePresent,
+  GraphQL::StaticValidation::ArgumentNamesAreUnique,
+  GraphQL::StaticValidation::VariableNamesAreUnique,
+  GraphQL::StaticValidation::VariablesAreInputTypes,
+  GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTyped,
+  GraphQL::StaticValidation::VariablesAreUsedAndDefined,
+  GraphQL::StaticValidation::VariableUsagesAreAllowed,
+  GraphQL::StaticValidation::MutationRootExists,
+  GraphQL::StaticValidation::QueryRootExists,
+  GraphQL::StaticValidation::SubscriptionRootExists,
+  GraphQL::StaticValidation::InputObjectNamesAreUnique,
+  GraphQL::StaticValidation::OneOfInputObjectsAreValid,
+]
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentLiteralsAreCompatible.html b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentLiteralsAreCompatible.html new file mode 100644 index 0000000000..da6e065cec --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentLiteralsAreCompatible.html @@ -0,0 +1,287 @@ + + + + + + + Module: GraphQL::StaticValidation::ArgumentLiteralsAreCompatible + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::ArgumentLiteralsAreCompatible + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/argument_literals_are_compatible.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_argument(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible.rb', line 5
+
+def on_argument(node, parent)
+  # Check the child arguments first;
+  # don't add a new error if one of them reports an error
+  super
+
+  # Don't validate variables here
+  if node.value.is_a?(GraphQL::Language::Nodes::VariableIdentifier)
+    return
+  end
+
+  if @context.schema.error_bubbling || context.errors.none? { |err| err.path.take(@path.size) == @path }
+    parent_defn = parent_definition(parent)
+
+    if parent_defn && (arg_defn = context.warden.get_argument(parent_defn, node.name))
+      validation_result = context.validate_literal(node.value, arg_defn.type)
+      if !validation_result.valid?
+        kind_of_node = node_type(parent)
+        error_arg_name = parent_name(parent, parent_defn)
+        string_value = if node.value == Float::INFINITY
+          ""
+        else
+          " (#{GraphQL::Language::Printer.new.print(node.value)})"
+        end
+
+        problems = validation_result.problems
+        first_problem = problems && problems.first
+        if first_problem
+          message = first_problem["message"]
+          # This is some legacy stuff from when `CoercionError` was raised thru the stack
+          if message
+            coerce_extensions = first_problem["extensions"] || {
+              "code" => "argumentLiteralsIncompatible"
+            }
+          end
+        end
+
+        error_options = {
+          nodes: parent,
+          type: kind_of_node,
+          argument_name: node.name,
+          argument: arg_defn,
+          value: node.value
+        }
+        if coerce_extensions
+          error_options[:coerce_extensions] = coerce_extensions
+        end
+
+        message ||= "Argument '#{node.name}' on #{kind_of_node} '#{error_arg_name}' has an invalid value#{string_value}. Expected type '#{arg_defn.type.to_type_signature}'."
+
+        error = GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError.new(
+          message,
+          **error_options
+        )
+
+        add_error(error)
+      end
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentLiteralsAreCompatibleError.html b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentLiteralsAreCompatibleError.html new file mode 100644 index 0000000000..00984e55f5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentLiteralsAreCompatibleError.html @@ -0,0 +1,674 @@ + + + + + + + Class: GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #argument ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute argument.

    +
    + +
  • + + +
  • + + + #argument_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute argument_name.

    +
    + +
  • + + +
  • + + + #type_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type_name.

    +
    + +
  • + + +
  • + + + #value ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute value.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], type:, argument_name: nil, extensions: nil, coerce_extensions: nil, argument: nil, value: nil) ⇒ ArgumentLiteralsAreCompatibleError + + + + + +

+
+

Returns a new instance of ArgumentLiteralsAreCompatibleError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 10
+
+def initialize(message, path: nil, nodes: [], type:, argument_name: nil, extensions: nil, coerce_extensions: nil, argument: nil, value: nil)
+  super(message, path: path, nodes: nodes)
+  @type_name = type
+  @argument_name = argument_name
+  @extensions = extensions
+  @coerce_extensions = coerce_extensions
+  @argument = argument
+  @value = value
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argumentObject (readonly) + + + + + +

+
+

Returns the value of attribute argument.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 7
+
+def argument
+  @argument
+end
+
+
+ + + +
+

+ + #argument_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute argument_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 6
+
+def argument_name
+  @argument_name
+end
+
+
+ + + +
+

+ + #type_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute type_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 5
+
+def type_name
+  @type_name
+end
+
+
+ + + +
+

+ + #valueObject (readonly) + + + + + +

+
+

Returns the value of attribute value.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 8
+
+def value
+  @value
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+43
+44
+45
+
+
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 43
+
+def code
+  "argumentLiteralsIncompatible"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 21
+
+def to_h
+  if @coerce_extensions
+    extensions = @coerce_extensions
+    # This is for legacy compat -- but this key is supposed to be a GraphQL type name :confounded:
+    extensions["typeName"] = "CoercionError"
+  else
+    extensions = {
+      "code" => code,
+      "typeName" => type_name
+    }
+
+    if argument_name
+      extensions["argumentName"] = argument_name
+    end
+  end
+
+  extensions.merge!(@extensions) unless @extensions.nil?
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentNamesAreUnique.html b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentNamesAreUnique.html new file mode 100644 index 0000000000..47276b296a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentNamesAreUnique.html @@ -0,0 +1,319 @@ + + + + + + + Module: GraphQL::StaticValidation::ArgumentNamesAreUnique + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::ArgumentNamesAreUnique + + + +

+
+ + + + + + +
+
Includes:
+
Error::ErrorHelper
+
+ + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/argument_names_are_unique.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Error::ErrorHelper

+

#error

+ + +
+

Instance Method Details

+ + +
+

+ + #on_directive(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+15
+
+
# File 'lib/graphql/static_validation/rules/argument_names_are_unique.rb', line 12
+
+def on_directive(node, parent)
+  validate_arguments(node)
+  super
+end
+
+
+ +
+

+ + #on_field(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/argument_names_are_unique.rb', line 7
+
+def on_field(node, parent)
+  validate_arguments(node)
+  super
+end
+
+
+ +
+

+ + #validate_arguments(node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/static_validation/rules/argument_names_are_unique.rb', line 17
+
+def validate_arguments(node)
+  argument_defns = node.arguments
+  if argument_defns.any?
+    args_by_name = Hash.new { |h, k| h[k] = [] }
+    argument_defns.each { |a| args_by_name[a.name] << a }
+    args_by_name.each do |name, defns|
+      if defns.size > 1
+        add_error(GraphQL::StaticValidation::ArgumentNamesAreUniqueError.new("There can be only one argument named \"#{name}\"", nodes: defns, name: name))
+      end
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentNamesAreUniqueError.html b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentNamesAreUniqueError.html new file mode 100644 index 0000000000..8e2462c6a1 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentNamesAreUniqueError.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::StaticValidation::ArgumentNamesAreUniqueError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::ArgumentNamesAreUniqueError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/argument_names_are_unique_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], name:) ⇒ ArgumentNamesAreUniqueError + + + + + +

+
+

Returns a new instance of ArgumentNamesAreUniqueError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/argument_names_are_unique_error.rb', line 7
+
+def initialize(message, path: nil, nodes: [], name:)
+  super(message, path: path, nodes: nodes)
+  @name = name
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nameObject (readonly) + + + + + +

+
+

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/argument_names_are_unique_error.rb', line 5
+
+def name
+  @name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/argument_names_are_unique_error.rb', line 24
+
+def code
+  "argumentNotUnique"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/argument_names_are_unique_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code,
+    "name" => name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentsAreDefined.html b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentsAreDefined.html new file mode 100644 index 0000000000..8a748e1ff6 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentsAreDefined.html @@ -0,0 +1,211 @@ + + + + + + + Module: GraphQL::StaticValidation::ArgumentsAreDefined + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::ArgumentsAreDefined + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/arguments_are_defined.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_argument(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/static_validation/rules/arguments_are_defined.rb', line 5
+
+def on_argument(node, parent)
+  parent_defn = parent_definition(parent)
+
+  if parent_defn && context.warden.get_argument(parent_defn, node.name)
+    super
+  elsif parent_defn
+    kind_of_node = node_type(parent)
+    error_arg_name = parent_name(parent, parent_defn)
+    add_error(GraphQL::StaticValidation::ArgumentsAreDefinedError.new(
+      "#{kind_of_node} '#{error_arg_name}' doesn't accept argument '#{node.name}'",
+      nodes: node,
+      name: error_arg_name,
+      type: kind_of_node,
+      argument_name: node.name,
+      parent: parent_defn
+    ))
+  else
+    # Some other weird error
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentsAreDefinedError.html b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentsAreDefinedError.html new file mode 100644 index 0000000000..314c37f074 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/ArgumentsAreDefinedError.html @@ -0,0 +1,652 @@ + + + + + + + Class: GraphQL::StaticValidation::ArgumentsAreDefinedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::ArgumentsAreDefinedError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/arguments_are_defined_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #argument_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute argument_name.

    +
    + +
  • + + +
  • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute name.

    +
    + +
  • + + +
  • + + + #parent ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute parent.

    +
    + +
  • + + +
  • + + + #type_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], name:, type:, argument_name:, parent:) ⇒ ArgumentsAreDefinedError + + + + + +

+
+

Returns a new instance of ArgumentsAreDefinedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/rules/arguments_are_defined_error.rb', line 10
+
+def initialize(message, path: nil, nodes: [], name:, type:, argument_name:, parent:)
+  super(message, path: path, nodes: nodes)
+  @name = name
+  @type_name = type
+  @argument_name = argument_name
+  @parent = parent
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argument_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute argument_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/static_validation/rules/arguments_are_defined_error.rb', line 7
+
+def argument_name
+  @argument_name
+end
+
+
+ + + +
+

+ + #nameObject (readonly) + + + + + +

+
+

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/arguments_are_defined_error.rb', line 5
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #parentObject (readonly) + + + + + +

+
+

Returns the value of attribute parent.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/arguments_are_defined_error.rb', line 8
+
+def parent
+  @parent
+end
+
+
+ + + +
+

+ + #type_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute type_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/arguments_are_defined_error.rb', line 6
+
+def type_name
+  @type_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/graphql/static_validation/rules/arguments_are_defined_error.rb', line 32
+
+def code
+  "argumentNotAccepted"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
+
# File 'lib/graphql/static_validation/rules/arguments_are_defined_error.rb', line 19
+
+def to_h
+  extensions = {
+    "code" => code,
+    "name" => name,
+    "typeName" => type_name,
+    "argumentName" => argument_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/BaseVisitor.html b/api-doc/2.1.6/GraphQL/StaticValidation/BaseVisitor.html new file mode 100644 index 0000000000..a562f0c8c3 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/BaseVisitor.html @@ -0,0 +1,646 @@ + + + + + + + Class: GraphQL::StaticValidation::BaseVisitor + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::BaseVisitor + + + +

+
+ +
+
Inherits:
+
+ Language::StaticVisitor + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/base_visitor.rb
+
+ +
+ +
+

Direct Known Subclasses

+

InterpreterVisitor

+
+

Defined Under Namespace

+

+ + + Modules: ContextMethods + + + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ +
    + +
  • + + + .including_rules(rules) ⇒ Class + + + + + + + + + + + + + +

    Build a class to visit the AST and perform validation, or use a pre-built class if rules is ALL_RULES or empty.

    +
    + +
  • + + +
+ +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Language::StaticVisitor

+

make_visit_methods, #on_argument_children, #on_document_children, #on_field_children, #on_fragment_definition_children, #on_operation_definition_children, #visit, #visit_directives, #visit_selections

+
+

Constructor Details

+ +
+

+ + #initialize(document, context) ⇒ BaseVisitor + + + + + +

+
+

Returns a new instance of BaseVisitor.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 5
+
+def initialize(document, context)
+  @path = []
+  @object_types = []
+  @directives = []
+  @field_definitions = []
+  @argument_definitions = []
+  @directive_definitions = []
+  @context = context
+  @schema = context.schema
+  super(document)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #contextObject (readonly) + + + + + +

+
+

Returns the value of attribute context.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 17
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #object_typesArray<GraphQL::ObjectType> (readonly) + + + + + +

+
+

Returns Types whose scope we’ve entered.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<GraphQL::ObjectType>) + + + + — +

    Types whose scope we’ve entered

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 20
+
+def object_types
+  @object_types
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .including_rules(rules) ⇒ Class + + + + + +

+
+

Build a class to visit the AST and perform validation, +or use a pre-built class if rules is ALL_RULES or empty.

+ + +
+
+
+

Parameters:

+
    + +
  • + + rules + + + (Array<Module, Class>) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    A class for validating rules during visitation

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 31
+
+def self.including_rules(rules)
+  if rules.empty?
+    # It's not doing _anything?!?_
+    BaseVisitor
+  elsif rules == ALL_RULES
+    InterpreterVisitor
+  else
+    visitor_class = Class.new(self) do
+      include(GraphQL::StaticValidation::DefinitionDependencies)
+    end
+
+    rules.reverse_each do |r|
+      # If it's a class, it gets attached later.
+      if !r.is_a?(Class)
+        visitor_class.include(r)
+      end
+    end
+
+    visitor_class.include(ContextMethods)
+    visitor_class
+  end
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #pathArray<String> + + + + + +

+
+

Returns The nesting of the current position in the AST.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<String>) + + + + — +

    The nesting of the current position in the AST

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 23
+
+def path
+  @path.dup
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/BaseVisitor/ContextMethods.html b/api-doc/2.1.6/GraphQL/StaticValidation/BaseVisitor/ContextMethods.html new file mode 100644 index 0000000000..4041900e46 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/BaseVisitor/ContextMethods.html @@ -0,0 +1,1060 @@ + + + + + + + Module: GraphQL::StaticValidation::BaseVisitor::ContextMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::BaseVisitor::ContextMethods + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/base_visitor.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #argument_definitionGraphQL::Argument? + + + + + +

+
+

Returns The most-recently-entered GraphQL::Argument, if currently inside one.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Argument, nil) + + + + — +

    The most-recently-entered GraphQL::Argument, if currently inside one

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+163
+164
+165
+166
+167
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 163
+
+def argument_definition
+  # Don't get the _last_ one because that's the current one.
+  # Get the second-to-last one, which is the parent of the current one.
+  @argument_definitions[-2]
+end
+
+
+ +
+

+ + #directive_definitionGraphQL::Directive? + + + + + +

+
+

Returns The most-recently-entered GraphQL::Directive, if currently inside one.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Directive, nil) + + + + — +

    The most-recently-entered GraphQL::Directive, if currently inside one

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+158
+159
+160
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 158
+
+def directive_definition
+  @directive_definitions.last
+end
+
+
+ +
+

+ + #field_definitionGraphQL::Field? + + + + + +

+
+

Returns The most-recently-entered GraphQL::Field, if currently inside one.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Field, nil) + + + + — +

    The most-recently-entered GraphQL::Field, if currently inside one

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+153
+154
+155
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 153
+
+def field_definition
+  @field_definitions.last
+end
+
+
+ +
+

+ + #on_argument(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 102
+
+def on_argument(node, parent)
+  argument_defn = if (arg = @argument_definitions.last)
+    arg_type = arg.type.unwrap
+    if arg_type.kind.input_object?
+      @context.warden.get_argument(arg_type, node.name)
+    else
+      nil
+    end
+  elsif (directive_defn = @directive_definitions.last)
+    @context.warden.get_argument(directive_defn, node.name)
+  elsif (field_defn = @field_definitions.last)
+    @context.warden.get_argument(field_defn, node.name)
+  else
+    nil
+  end
+
+  @argument_definitions.push(argument_defn)
+  @path.push(node.name)
+  super
+  @argument_definitions.pop
+  @path.pop
+end
+
+
+ +
+

+ + #on_directive(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+95
+96
+97
+98
+99
+100
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 95
+
+def on_directive(node, parent)
+  directive_defn = @context.schema_directives[node.name]
+  @directive_definitions.push(directive_defn)
+  super
+  @directive_definitions.pop
+end
+
+
+ +
+

+ + #on_field(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 78
+
+def on_field(node, parent)
+  parent_type = @object_types.last
+  field_definition = @schema.get_field(parent_type, node.name, @context.query.context)
+  @field_definitions.push(field_definition)
+  if !field_definition.nil?
+    next_object_type = field_definition.type.unwrap
+    push_type(next_object_type)
+  else
+    push_type(nil)
+  end
+  @path.push(node.alias || node.name)
+  super
+  @field_definitions.pop
+  @object_types.pop
+  @path.pop
+end
+
+
+ +
+

+ + #on_fragment_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+64
+65
+66
+67
+68
+69
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 64
+
+def on_fragment_definition(node, parent)
+  on_fragment_with_type(node) do
+    @path.push("fragment #{node.name}")
+    super
+  end
+end
+
+
+ +
+

+ + #on_fragment_spread(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+125
+126
+127
+128
+129
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 125
+
+def on_fragment_spread(node, parent)
+  @path.push("... #{node.name}")
+  super
+  @path.pop
+end
+
+
+ +
+

+ + #on_inline_fragment(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+71
+72
+73
+74
+75
+76
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 71
+
+def on_inline_fragment(node, parent)
+  on_fragment_with_type(node) do
+    @path.push("...#{node.type ? " on #{node.type.to_query_string}" : ""}")
+    super
+  end
+end
+
+
+ +
+

+ + #on_input_object(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 131
+
+def on_input_object(node, parent)
+  arg_defn = @argument_definitions.last
+  if arg_defn && arg_defn.type.list?
+    @path.push(parent.children.index(node))
+    super
+    @path.pop
+  else
+    super
+  end
+end
+
+
+ +
+

+ + #on_operation_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+55
+56
+57
+58
+59
+60
+61
+62
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 55
+
+def on_operation_definition(node, parent)
+  object_type = @schema.root_type_for_operation(node.operation_type)
+  push_type(object_type)
+  @path.push("#{node.operation_type}#{node.name ? " #{node.name}" : ""}")
+  super
+  @object_types.pop
+  @path.pop
+end
+
+
+ +
+

+ + #parent_type_definitionGraphQL::BaseType + + + + + +

+
+

Returns The type which the current type came from.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::BaseType) + + + + — +

    The type which the current type came from

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+148
+149
+150
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 148
+
+def parent_type_definition
+  @object_types[-2]
+end
+
+
+ +
+

+ + #type_definitionGraphQL::BaseType + + + + + +

+
+

Returns The current object type.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::BaseType) + + + + — +

    The current object type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+143
+144
+145
+
+
# File 'lib/graphql/static_validation/base_visitor.rb', line 143
+
+def type_definition
+  @object_types.last
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies.html b/api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies.html new file mode 100644 index 0000000000..1c23d75a0f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies.html @@ -0,0 +1,644 @@ + + + + + + + Module: GraphQL::StaticValidation::DefinitionDependencies + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::DefinitionDependencies + + + +

+
+ + + + + + + + + +
+
Included in:
+
InterpreterVisitor
+
+ + + +
+
Defined in:
+
lib/graphql/static_validation/definition_dependencies.rb
+
+ +
+ +

Overview

+
+

Track fragment dependencies for operations +and expose the fragment definitions which +are used by a given operation

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: DependencyMap, NodeWithPath + + +

+ + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #dependencies ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute dependencies.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #dependenciesObject (readonly) + + + + + +

+
+

Returns the value of attribute dependencies.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 8
+
+def dependencies
+  @dependencies
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #dependency_map(&block) ⇒ DependencyMap + + + + + +

+
+

A map of operation definitions to an array of that operation’s dependencies

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+69
+70
+71
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 69
+
+def dependency_map(&block)
+  @dependency_map ||= resolve_dependencies(&block)
+end
+
+
+ +
+

+ + #initializeObject + + + + + +

+ + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 10
+
+def initialize(*)
+  super
+  @defdep_node_paths = {}
+
+  # { name => [node, ...] } pairs for fragments (although duplicate-named fragments are _invalid_, they are _possible_)
+  @defdep_fragment_definitions = Hash.new{ |h, k| h[k] = [] }
+
+  # This tracks dependencies from fragment to Node where it was used
+  # { fragment_definition_name => [dependent_node, dependent_node]}
+  @defdep_dependent_definitions = Hash.new { |h, k| h[k] = Set.new }
+
+  # First-level usages of spreads within definitions
+  # (When a key has an empty list as its value,
+  #  we can resolve that key's dependents)
+  # { definition_node => [node, node ...] }
+  @defdep_immediate_dependencies = Hash.new { |h, k| h[k] = Set.new }
+
+  # When we encounter a spread,
+  # this node is the one who depends on it
+  @defdep_current_parent = nil
+end
+
+
+ +
+

+ + #on_document(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 32
+
+def on_document(node, parent)
+  node.definitions.each do |definition|
+    if definition.is_a? GraphQL::Language::Nodes::FragmentDefinition
+      @defdep_fragment_definitions[definition.name] << definition
+    end
+  end
+  super
+  @dependencies = dependency_map { |defn, spreads, frag|
+    context.on_dependency_resolve_handlers.each { |h| h.call(defn, spreads, frag) }
+  }
+end
+
+
+ +
+

+ + #on_fragment_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+51
+52
+53
+54
+55
+56
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 51
+
+def on_fragment_definition(node, parent)
+  @defdep_node_paths[node] = NodeWithPath.new(node, context.path)
+  @defdep_current_parent = node
+  super
+  @defdep_current_parent = nil
+end
+
+
+ +
+

+ + #on_fragment_spread(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+58
+59
+60
+61
+62
+63
+64
+65
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 58
+
+def on_fragment_spread(node, parent)
+  @defdep_node_paths[node] = NodeWithPath.new(node, context.path)
+
+  # Track both sides of the dependency
+  @defdep_dependent_definitions[node.name] << @defdep_current_parent
+  @defdep_immediate_dependencies[@defdep_current_parent] << node
+  super
+end
+
+
+ +
+

+ + #on_operation_definition(node, prev_node) ⇒ Object + + + + + +

+ + + + +
+
+
+
+44
+45
+46
+47
+48
+49
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 44
+
+def on_operation_definition(node, prev_node)
+  @defdep_node_paths[node.name] = NodeWithPath.new(node, context.path)
+  @defdep_current_parent = node
+  super
+  @defdep_current_parent = nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies/DependencyMap.html b/api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies/DependencyMap.html new file mode 100644 index 0000000000..03c21893a2 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies/DependencyMap.html @@ -0,0 +1,563 @@ + + + + + + + Class: GraphQL::StaticValidation::DefinitionDependencies::DependencyMap + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::DefinitionDependencies::DependencyMap + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/definition_dependencies.rb
+
+ +
+ +

Overview

+
+

Map definition AST nodes to the definition AST nodes they depend on. +Expose circular dependencies.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initializeDependencyMap + + + + + +

+
+

Returns a new instance of DependencyMap.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+85
+86
+87
+88
+89
+90
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 85
+
+def initialize
+  @dependencies = Hash.new { |h, k| h[k] = [] }
+  @cyclical_definitions = []
+  @unmet_dependencies = Hash.new { |h, k| h[k] = [] }
+  @unused_dependencies = []
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #cyclical_definitionsArray<GraphQL::Language::Nodes::FragmentDefinition> (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+77
+78
+79
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 77
+
+def cyclical_definitions
+  @cyclical_definitions
+end
+
+
+ + + +
+

+ + #unmet_dependenciesHash<Node, Array<GraphQL::Language::Nodes::FragmentSpread>> (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+80
+81
+82
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 80
+
+def unmet_dependencies
+  @unmet_dependencies
+end
+
+
+ + + +
+

+ + #unused_dependenciesArray<GraphQL::Language::Nodes::FragmentDefinition> (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+83
+84
+85
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 83
+
+def unused_dependencies
+  @unused_dependencies
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #[](definition_node) ⇒ Array<GraphQL::Language::Nodes::AbstractNode> + + + + + +

+
+

Returns dependencies for definition_node.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+93
+94
+95
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 93
+
+def [](definition_node)
+  @dependencies[definition_node]
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies/NodeWithPath.html b/api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies/NodeWithPath.html new file mode 100644 index 0000000000..9609ab90c2 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/DefinitionDependencies/NodeWithPath.html @@ -0,0 +1,359 @@ + + + + + + + Class: GraphQL::StaticValidation::DefinitionDependencies::NodeWithPath + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::DefinitionDependencies::NodeWithPath + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/definition_dependencies.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #node ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute node.

    +
    + +
  • + + +
  • + + + #path ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute path.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(node, path) ⇒ NodeWithPath + + + + + +

+
+

Returns a new instance of NodeWithPath.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+101
+102
+103
+104
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 101
+
+def initialize(node, path)
+  @node = node
+  @path = path
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nodeObject (readonly) + + + + + +

+
+

Returns the value of attribute node.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 100
+
+def node
+  @node
+end
+
+
+ + + +
+

+ + #pathObject (readonly) + + + + + +

+
+

Returns the value of attribute path.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+100
+101
+102
+
+
# File 'lib/graphql/static_validation/definition_dependencies.rb', line 100
+
+def path
+  @path
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreDefined.html b/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreDefined.html new file mode 100644 index 0000000000..cf56f4ac79 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreDefined.html @@ -0,0 +1,258 @@ + + + + + + + Module: GraphQL::StaticValidation::DirectivesAreDefined + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::DirectivesAreDefined + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/directives_are_defined.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #initializeObject + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/directives_are_defined.rb', line 5
+
+def initialize(*)
+  super
+  @directive_names = context.warden.directives.map(&:graphql_name)
+end
+
+
+ +
+

+ + #on_directive(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/directives_are_defined.rb', line 10
+
+def on_directive(node, parent)
+  if !@directive_names.include?(node.name)
+    @directives_are_defined_errors_by_name ||= {}
+    error = @directives_are_defined_errors_by_name[node.name] ||= begin
+      err = GraphQL::StaticValidation::DirectivesAreDefinedError.new(
+        "Directive @#{node.name} is not defined",
+        nodes: [],
+        directive: node.name
+      )
+      add_error(err)
+      err
+    end
+    error.nodes << node
+  else
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreDefinedError.html b/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreDefinedError.html new file mode 100644 index 0000000000..d82242a30b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreDefinedError.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::StaticValidation::DirectivesAreDefinedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::DirectivesAreDefinedError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/directives_are_defined_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #directive_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute directive_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], directive:) ⇒ DirectivesAreDefinedError + + + + + +

+
+

Returns a new instance of DirectivesAreDefinedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/directives_are_defined_error.rb', line 7
+
+def initialize(message, path: nil, nodes: [], directive:)
+  super(message, path: path, nodes: nodes)
+  @directive_name = directive
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #directive_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute directive_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/directives_are_defined_error.rb', line 5
+
+def directive_name
+  @directive_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/directives_are_defined_error.rb', line 24
+
+def code
+  "undefinedDirective"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/directives_are_defined_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code,
+    "directiveName" => directive_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreInValidLocations.html b/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreInValidLocations.html new file mode 100644 index 0000000000..0edb3ec0cc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreInValidLocations.html @@ -0,0 +1,193 @@ + + + + + + + Module: GraphQL::StaticValidation::DirectivesAreInValidLocations + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::DirectivesAreInValidLocations + + + +

+
+ + + + + + +
+
Includes:
+
Language
+
+ + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Language

+

serialize

+ + +
+

Instance Method Details

+ + +
+

+ + #on_directive(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb', line 7
+
+def on_directive(node, parent)
+  validate_location(node, parent, context.schema_directives)
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreInValidLocationsError.html b/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreInValidLocationsError.html new file mode 100644 index 0000000000..bdb2981f9d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/DirectivesAreInValidLocationsError.html @@ -0,0 +1,504 @@ + + + + + + + Class: GraphQL::StaticValidation::DirectivesAreInValidLocationsError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::DirectivesAreInValidLocationsError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute name.

    +
    + +
  • + + +
  • + + + #target_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute target_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], target:, name: nil) ⇒ DirectivesAreInValidLocationsError + + + + + +

+
+

Returns a new instance of DirectivesAreInValidLocationsError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+
+
# File 'lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb', line 8
+
+def initialize(message, path: nil, nodes: [], target:, name: nil)
+  super(message, path: path, nodes: nodes)
+  @target_name = target
+  @name = name
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nameObject (readonly) + + + + + +

+
+

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb', line 6
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #target_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute target_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb', line 5
+
+def target_name
+  @target_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb', line 26
+
+def code
+  "directiveCannotBeApplied"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb', line 15
+
+def to_h
+  extensions = {
+    "code" => code,
+    "targetName" => target_name
+  }.tap { |h| h["name"] = name unless name.nil? }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/Error.html b/api-doc/2.1.6/GraphQL/StaticValidation/Error.html new file mode 100644 index 0000000000..b6b461fd59 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/Error.html @@ -0,0 +1,522 @@ + + + + + + + Class: GraphQL::StaticValidation::Error + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::Error + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/error.rb
+
+ +
+ +

Overview

+
+

Generates GraphQL-compliant validation message.

+ + +
+
+
+ + +
+

Defined Under Namespace

+

+ + + Modules: ErrorHelper + + + + +

+ + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #message ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute message.

    +
    + +
  • + + +
  • + + + #nodes ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute nodes.

    +
    + +
  • + + +
  • + + + #path ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute path.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: []) ⇒ Error + + + + + +

+
+

Returns a new instance of Error.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+
+
# File 'lib/graphql/static_validation/error.rb', line 19
+
+def initialize(message, path: nil, nodes: [])
+  @message = message
+  @nodes = Array(nodes)
+  @path = path
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #messageObject (readonly) + + + + + +

+
+

Returns the value of attribute message.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/error.rb', line 16
+
+def message
+  @message
+end
+
+
+ + + +
+

+ + #nodesObject (readonly) + + + + + +

+
+

Returns the value of attribute nodes.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/static_validation/error.rb', line 33
+
+def nodes
+  @nodes
+end
+
+
+ + + +
+

+ + #pathObject + + + + + +

+
+

Returns the value of attribute path.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/static_validation/error.rb', line 17
+
+def path
+  @path
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+
+
# File 'lib/graphql/static_validation/error.rb', line 26
+
+def to_h
+  {
+    "message" => message,
+    "locations" => locations
+  }.tap { |h| h["path"] = path unless path.nil? }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/Error/ErrorHelper.html b/api-doc/2.1.6/GraphQL/StaticValidation/Error/ErrorHelper.html new file mode 100644 index 0000000000..9a95ebfec3 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/Error/ErrorHelper.html @@ -0,0 +1,204 @@ + + + + + + + Module: GraphQL::StaticValidation::Error::ErrorHelper + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::Error::ErrorHelper + + + +

+
+ + + + + + + + + +
+
Included in:
+
ArgumentNamesAreUnique, FieldsHaveAppropriateSelections, NoDefinitionsArePresent
+
+ + + +
+
Defined in:
+
lib/graphql/static_validation/error.rb
+
+ +
+ +

Overview

+
+

Convenience for validators

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #error(error_message, nodes, context: nil, path: nil, extensions: {}) ⇒ Object + + + + + +

+
+

Error error_message is located at node

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+12
+13
+
+
# File 'lib/graphql/static_validation/error.rb', line 9
+
+def error(error_message, nodes, context: nil, path: nil, extensions: {})
+  path ||= context.path
+  nodes = Array(nodes)
+  GraphQL::StaticValidation::Error.new(error_message, nodes: nodes, path: path)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FieldsAreDefinedOnType.html b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsAreDefinedOnType.html new file mode 100644 index 0000000000..95b1b79b29 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsAreDefinedOnType.html @@ -0,0 +1,215 @@ + + + + + + + Module: GraphQL::StaticValidation::FieldsAreDefinedOnType + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::FieldsAreDefinedOnType + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fields_are_defined_on_type.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_field(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
+
# File 'lib/graphql/static_validation/rules/fields_are_defined_on_type.rb', line 5
+
+def on_field(node, parent)
+  parent_type = @object_types[-2]
+  field = context.warden.get_field(parent_type, node.name)
+
+  if field.nil?
+    if parent_type.kind.union?
+      add_error(GraphQL::StaticValidation::FieldsHaveAppropriateSelectionsError.new(
+        "Selections can't be made directly on unions (see selections on #{parent_type.graphql_name})",
+        nodes: parent,
+        node_name: parent_type.graphql_name
+      ))
+    else
+      add_error(GraphQL::StaticValidation::FieldsAreDefinedOnTypeError.new(
+        "Field '#{node.name}' doesn't exist on type '#{parent_type.graphql_name}'",
+        nodes: node,
+        field: node.name,
+        type: parent_type.graphql_name
+      ))
+    end
+  else
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FieldsAreDefinedOnTypeError.html b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsAreDefinedOnTypeError.html new file mode 100644 index 0000000000..30e6736aa2 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsAreDefinedOnTypeError.html @@ -0,0 +1,506 @@ + + + + + + + Class: GraphQL::StaticValidation::FieldsAreDefinedOnTypeError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FieldsAreDefinedOnTypeError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #field_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute field_name.

    +
    + +
  • + + +
  • + + + #type_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], type:, field:) ⇒ FieldsAreDefinedOnTypeError + + + + + +

+
+

Returns a new instance of FieldsAreDefinedOnTypeError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+
+
# File 'lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb', line 8
+
+def initialize(message, path: nil, nodes: [], type:, field:)
+  super(message, path: path, nodes: nodes)
+  @type_name = type
+  @field_name = field
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #field_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute field_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb', line 6
+
+def field_name
+  @field_name
+end
+
+
+ + + +
+

+ + #type_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute type_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb', line 5
+
+def type_name
+  @type_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb', line 27
+
+def code
+  "undefinedField"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb', line 15
+
+def to_h
+  extensions = {
+    "code" => code,
+    "typeName" => type_name,
+    "fieldName" => field_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FieldsHaveAppropriateSelections.html b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsHaveAppropriateSelections.html new file mode 100644 index 0000000000..e6bc5b2046 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsHaveAppropriateSelections.html @@ -0,0 +1,265 @@ + + + + + + + Module: GraphQL::StaticValidation::FieldsHaveAppropriateSelections + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::FieldsHaveAppropriateSelections + + + +

+
+ + + + + + +
+
Includes:
+
Error::ErrorHelper
+
+ + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb
+
+ +
+ +

Overview

+
+

Scalars can’t have selections +Objects must have selections

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Error::ErrorHelper

+

#error

+ + +
+

Instance Method Details

+ + +
+

+ + #on_field(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb', line 9
+
+def on_field(node, parent)
+  field_defn = field_definition
+  if validate_field_selections(node, field_defn.type.unwrap)
+    super
+  end
+end
+
+
+ +
+

+ + #on_operation_definition(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+19
+20
+
+
# File 'lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb', line 16
+
+def on_operation_definition(node, _parent)
+  if validate_field_selections(node, type_definition)
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FieldsHaveAppropriateSelectionsError.html b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsHaveAppropriateSelectionsError.html new file mode 100644 index 0000000000..8f7dd21296 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsHaveAppropriateSelectionsError.html @@ -0,0 +1,504 @@ + + + + + + + Class: GraphQL::StaticValidation::FieldsHaveAppropriateSelectionsError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FieldsHaveAppropriateSelectionsError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #node_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute node_name.

    +
    + +
  • + + +
  • + + + #type_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], node_name:, type: nil) ⇒ FieldsHaveAppropriateSelectionsError + + + + + +

+
+

Returns a new instance of FieldsHaveAppropriateSelectionsError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+
+
# File 'lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb', line 8
+
+def initialize(message, path: nil, nodes: [], node_name:, type: nil)
+  super(message, path: path, nodes: nodes)
+  @node_name = node_name
+  @type_name = type
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #node_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute node_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb', line 6
+
+def node_name
+  @node_name
+end
+
+
+ + + +
+

+ + #type_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute type_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb', line 5
+
+def type_name
+  @type_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb', line 26
+
+def code
+  "selectionMismatch"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb', line 15
+
+def to_h
+  extensions = {
+    "code" => code,
+    "nodeName" => node_name
+  }.tap { |h| h["typeName"] = type_name unless type_name.nil? }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge.html b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge.html new file mode 100644 index 0000000000..b637729f8b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge.html @@ -0,0 +1,331 @@ + + + + + + + Module: GraphQL::StaticValidation::FieldsWillMerge + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::FieldsWillMerge + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fields_will_merge.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: Field, FragmentSpread + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
NO_ARGS = +
+
+

Validates that a selection set is valid if all fields (including spreading any +fragments) either correspond to distinct response names or can be merged +without ambiguity.

+ +

Original Algorithm: https://github.com/graphql/graphql-js/blob/master/src/validation/rules/OverlappingFieldsCanBeMerged.js

+ + +
+
+
+ + +
+
+
GraphQL::EmptyObjects::EMPTY_HASH
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #initializeObject + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 17
+
+def initialize(*)
+  super
+  @visited_fragments = {}
+  @compared_fragments = {}
+  @conflict_count = 0
+end
+
+
+ +
+

+ + #on_field(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+29
+30
+31
+32
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 29
+
+def on_field(node, _parent)
+  setting_errors { conflicts_within_selection_set(node, type_definition) }
+  super
+end
+
+
+ +
+

+ + #on_operation_definition(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+27
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 24
+
+def on_operation_definition(node, _parent)
+  setting_errors { conflicts_within_selection_set(node, type_definition) }
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge/Field.html b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge/Field.html new file mode 100644 index 0000000000..4af7e9af2c --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge/Field.html @@ -0,0 +1,474 @@ + + + + + + + Class: GraphQL::StaticValidation::FieldsWillMerge::Field + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FieldsWillMerge::Field + + + +

+
+ +
+
Inherits:
+
+ Struct + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fields_will_merge.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #definition ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute definition.

    +
    + +
  • + + +
  • + + + #node ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute node.

    +
    + +
  • + + +
  • + + + #owner_type ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute owner_type.

    +
    + +
  • + + +
  • + + + #parents ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute parents.

    +
    + +
  • + + +
+ + + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #definitionObject + + + + + +

+
+

Returns the value of attribute definition

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the current value of definition

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 14
+
+def definition
+  @definition
+end
+
+
+ + + +
+

+ + #nodeObject + + + + + +

+
+

Returns the value of attribute node

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the current value of node

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 14
+
+def node
+  @node
+end
+
+
+ + + +
+

+ + #owner_typeObject + + + + + +

+
+

Returns the value of attribute owner_type

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the current value of owner_type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 14
+
+def owner_type
+  @owner_type
+end
+
+
+ + + +
+

+ + #parentsObject + + + + + +

+
+

Returns the value of attribute parents

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the current value of parents

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 14
+
+def parents
+  @parents
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge/FragmentSpread.html b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge/FragmentSpread.html new file mode 100644 index 0000000000..f35c33e3bf --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMerge/FragmentSpread.html @@ -0,0 +1,304 @@ + + + + + + + Class: GraphQL::StaticValidation::FieldsWillMerge::FragmentSpread + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FieldsWillMerge::FragmentSpread + + + +

+
+ +
+
Inherits:
+
+ Struct + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fields_will_merge.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #name ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute name.

    +
    + +
  • + + +
  • + + + #parents ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute parents.

    +
    + +
  • + + +
+ + + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #nameObject + + + + + +

+
+

Returns the value of attribute name

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the current value of name

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 15
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #parentsObject + + + + + +

+
+

Returns the value of attribute parents

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the current value of parents

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge.rb', line 15
+
+def parents
+  @parents
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMergeError.html b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMergeError.html new file mode 100644 index 0000000000..d171b51cf8 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FieldsWillMergeError.html @@ -0,0 +1,728 @@ + + + + + + + Class: GraphQL::StaticValidation::FieldsWillMergeError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FieldsWillMergeError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fields_will_merge_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #field_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute field_name.

    +
    + +
  • + + +
  • + + + #kind ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute kind.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#nodes

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(kind:, field_name:) ⇒ FieldsWillMergeError + + + + + +

+
+

Returns a new instance of FieldsWillMergeError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 8
+
+def initialize(kind:, field_name:)
+  super(nil)
+
+  @field_name = field_name
+  @kind = kind
+  @conflicts = []
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #field_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute field_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 5
+
+def field_name
+  @field_name
+end
+
+
+ + + +
+

+ + #kindObject (readonly) + + + + + +

+
+

Returns the value of attribute kind.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 6
+
+def kind
+  @kind
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #add_conflict(node, conflict_str) ⇒ Object + + + + + +

+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 28
+
+def add_conflict(node, conflict_str)
+  return if nodes.include?(node)
+
+  @nodes << node
+  @conflicts << conflict_str
+end
+
+
+ +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 48
+
+def code
+  "fieldConflict"
+end
+
+
+ +
+

+ + #conflictsObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 24
+
+def conflicts
+  @conflicts.join(' or ')
+end
+
+
+ +
+

+ + #messageObject + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 16
+
+def message
+  "Field '#{field_name}' has #{kind == :argument ? 'an' : 'a'} #{kind} conflict: #{conflicts}?"
+end
+
+
+ +
+

+ + #pathObject + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 20
+
+def path
+  []
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'lib/graphql/static_validation/rules/fields_will_merge_error.rb', line 36
+
+def to_h
+  extensions = {
+    "code" => code,
+    "fieldName" => field_name,
+    "conflicts" => conflicts
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentNamesAreUnique.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentNamesAreUnique.html new file mode 100644 index 0000000000..1cac7e130e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentNamesAreUnique.html @@ -0,0 +1,303 @@ + + + + + + + Module: GraphQL::StaticValidation::FragmentNamesAreUnique + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::FragmentNamesAreUnique + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragment_names_are_unique.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #initializeObject + + + + + +

+ + + + +
+
+
+
+6
+7
+8
+9
+
+
# File 'lib/graphql/static_validation/rules/fragment_names_are_unique.rb', line 6
+
+def initialize(*)
+  super
+  @fragments_by_name = Hash.new { |h, k| h[k] = [] }
+end
+
+
+ +
+

+ + #on_document(_n, _p) ⇒ Object + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
+
# File 'lib/graphql/static_validation/rules/fragment_names_are_unique.rb', line 16
+
+def on_document(_n, _p)
+  super
+  @fragments_by_name.each do |name, fragments|
+    if fragments.length > 1
+      add_error(GraphQL::StaticValidation::FragmentNamesAreUniqueError.new(
+        %|Fragment name "#{name}" must be unique|,
+        nodes: fragments,
+        name: name
+      ))
+    end
+  end
+end
+
+
+ +
+

+ + #on_fragment_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/fragment_names_are_unique.rb', line 11
+
+def on_fragment_definition(node, parent)
+  @fragments_by_name[node.name] << node
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentNamesAreUniqueError.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentNamesAreUniqueError.html new file mode 100644 index 0000000000..d9204bee1d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentNamesAreUniqueError.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::StaticValidation::FragmentNamesAreUniqueError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FragmentNamesAreUniqueError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #fragment_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute fragment_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], name:) ⇒ FragmentNamesAreUniqueError + + + + + +

+
+

Returns a new instance of FragmentNamesAreUniqueError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb', line 7
+
+def initialize(message, path: nil, nodes: [], name:)
+  super(message, path: path, nodes: nodes)
+  @fragment_name = name
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #fragment_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute fragment_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb', line 5
+
+def fragment_name
+  @fragment_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb', line 24
+
+def code
+  "fragmentNotUnique"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code,
+    "fragmentName" => fragment_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossible.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossible.html new file mode 100644 index 0000000000..0f1c029038 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossible.html @@ -0,0 +1,382 @@ + + + + + + + Module: GraphQL::StaticValidation::FragmentSpreadsArePossible + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::FragmentSpreadsArePossible + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: FragmentSpread + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #initializeObject + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb', line 5
+
+def initialize(*)
+  super
+  @spreads_to_validate = []
+end
+
+
+ +
+

+ + #on_document(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb', line 25
+
+def on_document(node, parent)
+  super
+  @spreads_to_validate.each do |frag_spread|
+    frag_node = context.fragments[frag_spread.node.name]
+    if frag_node
+      fragment_child_name = frag_node.type.name
+      fragment_child = context.warden.get_type(fragment_child_name)
+      # Might be non-existent type name
+      if fragment_child
+        validate_fragment_in_scope(frag_spread.parent_type, fragment_child, frag_spread.node, context, frag_spread.path)
+      end
+    end
+  end
+end
+
+
+ +
+

+ + #on_fragment_spread(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+19
+20
+21
+22
+23
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb', line 19
+
+def on_fragment_spread(node, parent)
+  fragment_parent = context.object_types.last
+  @spreads_to_validate << FragmentSpread.new(node: node, parent_type: fragment_parent, path: context.path)
+  super
+end
+
+
+ +
+

+ + #on_inline_fragment(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb', line 10
+
+def on_inline_fragment(node, parent)
+  fragment_parent = context.object_types[-2]
+  fragment_child = context.object_types.last
+  if fragment_child
+    validate_fragment_in_scope(fragment_parent, fragment_child, node, context, context.path)
+  end
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossible/FragmentSpread.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossible/FragmentSpread.html new file mode 100644 index 0000000000..e9e80a7a76 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossible/FragmentSpread.html @@ -0,0 +1,425 @@ + + + + + + + Class: GraphQL::StaticValidation::FragmentSpreadsArePossible::FragmentSpread + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FragmentSpreadsArePossible::FragmentSpread + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #node ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute node.

    +
    + +
  • + + +
  • + + + #parent_type ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute parent_type.

    +
    + +
  • + + +
  • + + + #path ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute path.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(node:, parent_type:, path:) ⇒ FragmentSpread + + + + + +

+
+

Returns a new instance of FragmentSpread.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+65
+66
+67
+68
+69
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb', line 65
+
+def initialize(node:, parent_type:, path:)
+  @node = node
+  @parent_type = parent_type
+  @path = path
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nodeObject (readonly) + + + + + +

+
+

Returns the value of attribute node.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+64
+65
+66
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb', line 64
+
+def node
+  @node
+end
+
+
+ + + +
+

+ + #parent_typeObject (readonly) + + + + + +

+
+

Returns the value of attribute parent_type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+64
+65
+66
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb', line 64
+
+def parent_type
+  @parent_type
+end
+
+
+ + + +
+

+ + #pathObject (readonly) + + + + + +

+
+

Returns the value of attribute path.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+64
+65
+66
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb', line 64
+
+def path
+  @path
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossibleError.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossibleError.html new file mode 100644 index 0000000000..93cc7ea569 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentSpreadsArePossibleError.html @@ -0,0 +1,580 @@ + + + + + + + Class: GraphQL::StaticValidation::FragmentSpreadsArePossibleError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FragmentSpreadsArePossibleError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #fragment_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute fragment_name.

    +
    + +
  • + + +
  • + + + #parent_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute parent_name.

    +
    + +
  • + + +
  • + + + #type_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], type:, fragment_name:, parent:) ⇒ FragmentSpreadsArePossibleError + + + + + +

+
+

Returns a new instance of FragmentSpreadsArePossibleError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb', line 9
+
+def initialize(message, path: nil, nodes: [], type:, fragment_name:, parent:)
+  super(message, path: path, nodes: nodes)
+  @type_name = type
+  @fragment_name = fragment_name
+  @parent_name = parent
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #fragment_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute fragment_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb', line 6
+
+def fragment_name
+  @fragment_name
+end
+
+
+ + + +
+

+ + #parent_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute parent_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb', line 7
+
+def parent_name
+  @parent_name
+end
+
+
+ + + +
+

+ + #type_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute type_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb', line 5
+
+def type_name
+  @type_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb', line 30
+
+def code
+  "cannotSpreadFragment"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb', line 17
+
+def to_h
+  extensions = {
+    "code" => code,
+    "typeName" => type_name,
+    "fragmentName" => fragment_name,
+    "parentName" => parent_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentTypesExist.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentTypesExist.html new file mode 100644 index 0000000000..dddbfe7f02 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentTypesExist.html @@ -0,0 +1,236 @@ + + + + + + + Module: GraphQL::StaticValidation::FragmentTypesExist + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::FragmentTypesExist + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragment_types_exist.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_fragment_definition(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+
+
# File 'lib/graphql/static_validation/rules/fragment_types_exist.rb', line 5
+
+def on_fragment_definition(node, _parent)
+  if validate_type_exists(node)
+    super
+  end
+end
+
+
+ +
+

+ + #on_inline_fragment(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+11
+12
+13
+14
+15
+
+
# File 'lib/graphql/static_validation/rules/fragment_types_exist.rb', line 11
+
+def on_inline_fragment(node, _parent)
+  if validate_type_exists(node)
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentTypesExistError.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentTypesExistError.html new file mode 100644 index 0000000000..56a227f129 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentTypesExistError.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::StaticValidation::FragmentTypesExistError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FragmentTypesExistError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragment_types_exist_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #type_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], type:) ⇒ FragmentTypesExistError + + + + + +

+
+

Returns a new instance of FragmentTypesExistError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/fragment_types_exist_error.rb', line 7
+
+def initialize(message, path: nil, nodes: [], type:)
+  super(message, path: path, nodes: nodes)
+  @type_name = type
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #type_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute type_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/fragment_types_exist_error.rb', line 5
+
+def type_name
+  @type_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/fragment_types_exist_error.rb', line 24
+
+def code
+  "undefinedType"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/fragment_types_exist_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code,
+    "typeName" => type_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreFinite.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreFinite.html new file mode 100644 index 0000000000..f7592bfd01 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreFinite.html @@ -0,0 +1,197 @@ + + + + + + + Module: GraphQL::StaticValidation::FragmentsAreFinite + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::FragmentsAreFinite + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragments_are_finite.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_document(_n, _p) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_finite.rb', line 5
+
+def on_document(_n, _p)
+  super
+  dependency_map = context.dependencies
+  dependency_map.cyclical_definitions.each do |defn|
+    if defn.node.is_a?(GraphQL::Language::Nodes::FragmentDefinition)
+      add_error(GraphQL::StaticValidation::FragmentsAreFiniteError.new(
+        "Fragment #{defn.name} contains an infinite loop",
+        nodes: defn.node,
+        path: defn.path,
+        name: defn.name
+      ))
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreFiniteError.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreFiniteError.html new file mode 100644 index 0000000000..f8661f76ee --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreFiniteError.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::StaticValidation::FragmentsAreFiniteError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FragmentsAreFiniteError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragments_are_finite_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #fragment_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute fragment_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], name:) ⇒ FragmentsAreFiniteError + + + + + +

+
+

Returns a new instance of FragmentsAreFiniteError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_finite_error.rb', line 7
+
+def initialize(message, path: nil, nodes: [], name:)
+  super(message, path: path, nodes: nodes)
+  @fragment_name = name
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #fragment_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute fragment_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_finite_error.rb', line 5
+
+def fragment_name
+  @fragment_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_finite_error.rb', line 24
+
+def code
+  "infiniteLoop"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_finite_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code,
+    "fragmentName" => fragment_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreNamed.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreNamed.html new file mode 100644 index 0000000000..8c06b5ad97 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreNamed.html @@ -0,0 +1,187 @@ + + + + + + + Module: GraphQL::StaticValidation::FragmentsAreNamed + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::FragmentsAreNamed + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragments_are_named.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_fragment_definition(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_named.rb', line 5
+
+def on_fragment_definition(node, _parent)
+  if node.name.nil?
+    add_error(GraphQL::StaticValidation::FragmentsAreNamedError.new(
+      "Fragment definition has no name",
+      nodes: node
+    ))
+  end
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreNamedError.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreNamedError.html new file mode 100644 index 0000000000..223f4705bc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreNamedError.html @@ -0,0 +1,348 @@ + + + + + + + Class: GraphQL::StaticValidation::FragmentsAreNamedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FragmentsAreNamedError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragments_are_named_error.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: []) ⇒ FragmentsAreNamedError + + + + + +

+
+

Returns a new instance of FragmentsAreNamedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_named_error.rb', line 6
+
+def initialize(message, path: nil, nodes: [])
+  super(message, path: path, nodes: nodes)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_named_error.rb', line 21
+
+def code
+  "anonymousFragment"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_named_error.rb', line 11
+
+def to_h
+  extensions = {
+    "code" => code,
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreOnCompositeTypes.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreOnCompositeTypes.html new file mode 100644 index 0000000000..0247af2052 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreOnCompositeTypes.html @@ -0,0 +1,228 @@ + + + + + + + Module: GraphQL::StaticValidation::FragmentsAreOnCompositeTypes + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::FragmentsAreOnCompositeTypes + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_fragment_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb', line 5
+
+def on_fragment_definition(node, parent)
+  validate_type_is_composite(node) && super
+end
+
+
+ +
+

+ + #on_inline_fragment(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb', line 9
+
+def on_inline_fragment(node, parent)
+  validate_type_is_composite(node) && super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreOnCompositeTypesError.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreOnCompositeTypesError.html new file mode 100644 index 0000000000..3d17afd825 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreOnCompositeTypesError.html @@ -0,0 +1,502 @@ + + + + + + + Class: GraphQL::StaticValidation::FragmentsAreOnCompositeTypesError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FragmentsAreOnCompositeTypesError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #argument_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute argument_name.

    +
    + +
  • + + +
  • + + + #type_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], type:) ⇒ FragmentsAreOnCompositeTypesError + + + + + +

+
+

Returns a new instance of FragmentsAreOnCompositeTypesError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb', line 8
+
+def initialize(message, path: nil, nodes: [], type:)
+  super(message, path: path, nodes: nodes)
+  @type_name = type
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argument_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute argument_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb', line 6
+
+def argument_name
+  @argument_name
+end
+
+
+ + + +
+

+ + #type_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute type_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb', line 5
+
+def type_name
+  @type_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+25
+26
+27
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb', line 25
+
+def code
+  "fragmentOnNonCompositeType"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb', line 14
+
+def to_h
+  extensions = {
+    "code" => code,
+    "typeName" => type_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreUsed.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreUsed.html new file mode 100644 index 0000000000..3f02184a99 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreUsed.html @@ -0,0 +1,219 @@ + + + + + + + Module: GraphQL::StaticValidation::FragmentsAreUsed + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::FragmentsAreUsed + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragments_are_used.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_document(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_used.rb', line 5
+
+def on_document(node, parent)
+  super
+  dependency_map = context.dependencies
+  dependency_map.unmet_dependencies.each do |op_defn, spreads|
+    spreads.each do |fragment_spread|
+      add_error(GraphQL::StaticValidation::FragmentsAreUsedError.new(
+        "Fragment #{fragment_spread.name} was used, but not defined",
+        nodes: fragment_spread.node,
+        path: fragment_spread.path,
+        fragment: fragment_spread.name
+      ))
+    end
+  end
+
+  dependency_map.unused_dependencies.each do |fragment|
+    if fragment && !fragment.name.nil?
+      add_error(GraphQL::StaticValidation::FragmentsAreUsedError.new(
+        "Fragment #{fragment.name} was defined, but not used",
+        nodes: fragment.node,
+        path: fragment.path,
+        fragment: fragment.name
+      ))
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreUsedError.html b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreUsedError.html new file mode 100644 index 0000000000..573711dc39 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/FragmentsAreUsedError.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::StaticValidation::FragmentsAreUsedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::FragmentsAreUsedError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/fragments_are_used_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #fragment_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute fragment_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], fragment:) ⇒ FragmentsAreUsedError + + + + + +

+
+

Returns a new instance of FragmentsAreUsedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_used_error.rb', line 7
+
+def initialize(message, path: nil, nodes: [], fragment:)
+  super(message, path: path, nodes: nodes)
+  @fragment_name = fragment
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #fragment_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute fragment_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_used_error.rb', line 5
+
+def fragment_name
+  @fragment_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_used_error.rb', line 24
+
+def code
+  "useAndDefineFragment"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/fragments_are_used_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code,
+    "fragmentName" => fragment_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/InputObjectNamesAreUnique.html b/api-doc/2.1.6/GraphQL/StaticValidation/InputObjectNamesAreUnique.html new file mode 100644 index 0000000000..39f6e2b53f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/InputObjectNamesAreUnique.html @@ -0,0 +1,177 @@ + + + + + + + Module: GraphQL::StaticValidation::InputObjectNamesAreUnique + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::InputObjectNamesAreUnique + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/input_object_names_are_unique.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_input_object(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/input_object_names_are_unique.rb', line 5
+
+def on_input_object(node, parent)
+  validate_input_fields(node)
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/InputObjectNamesAreUniqueError.html b/api-doc/2.1.6/GraphQL/StaticValidation/InputObjectNamesAreUniqueError.html new file mode 100644 index 0000000000..47cb16cf14 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/InputObjectNamesAreUniqueError.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::StaticValidation::InputObjectNamesAreUniqueError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::InputObjectNamesAreUniqueError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], name:) ⇒ InputObjectNamesAreUniqueError + + + + + +

+
+

Returns a new instance of InputObjectNamesAreUniqueError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb', line 7
+
+def initialize(message, path: nil, nodes: [], name:)
+  super(message, path: path, nodes: nodes)
+  @name = name
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #nameObject (readonly) + + + + + +

+
+

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb', line 5
+
+def name
+  @name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb', line 24
+
+def code
+  "inputFieldNotUnique"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code,
+    "name" => name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/InterpreterVisitor.html b/api-doc/2.1.6/GraphQL/StaticValidation/InterpreterVisitor.html new file mode 100644 index 0000000000..1d13f8cec5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/InterpreterVisitor.html @@ -0,0 +1,174 @@ + + + + + + + Class: GraphQL::StaticValidation::InterpreterVisitor + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::InterpreterVisitor + + + +

+
+ +
+
Inherits:
+
+ BaseVisitor + + + show all + +
+
+ + + + + + +
+
Includes:
+
ContextMethods, DefinitionDependencies
+
+ + + + + + +
+
Defined in:
+
lib/graphql/static_validation/interpreter_visitor.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes included from DefinitionDependencies

+

#dependencies

+ + + +

Attributes inherited from BaseVisitor

+

#context, #object_types

+ + + + + + + + + + +

Method Summary

+ +

Methods included from DefinitionDependencies

+

#dependency_map, #initialize, #on_document, #on_fragment_definition, #on_fragment_spread, #on_operation_definition

+ + + + + + + + + +

Methods inherited from BaseVisitor

+

including_rules, #initialize, #path

+ + + + + + + + + +

Methods inherited from Language::StaticVisitor

+

#initialize, make_visit_methods, #on_argument_children, #on_document_children, #on_field_children, #on_fragment_definition_children, #on_operation_definition_children, #visit, #visit_directives, #visit_selections

+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/LiteralValidator.html b/api-doc/2.1.6/GraphQL/StaticValidation/LiteralValidator.html new file mode 100644 index 0000000000..3944b9330f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/LiteralValidator.html @@ -0,0 +1,280 @@ + + + + + + + Class: GraphQL::StaticValidation::LiteralValidator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::LiteralValidator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/literal_validator.rb
+
+ +
+ +

Overview

+
+

Test whether ast_value is a valid input for type

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(context:) ⇒ LiteralValidator + + + + + +

+
+

Returns a new instance of LiteralValidator.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+9
+10
+11
+
+
# File 'lib/graphql/static_validation/literal_validator.rb', line 6
+
+def initialize(context:)
+  @context = context
+  @warden = context.warden
+  @invalid_response = GraphQL::Query::InputValidationResult.new(valid: false, problems: [])
+  @valid_response = GraphQL::Query::InputValidationResult.new(valid: true, problems: [])
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #validate(ast_value, type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/static_validation/literal_validator.rb', line 13
+
+def validate(ast_value, type)
+  catch(:invalid) do
+    recursively_validate(ast_value, type)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/MutationRootExists.html b/api-doc/2.1.6/GraphQL/StaticValidation/MutationRootExists.html new file mode 100644 index 0000000000..452049378e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/MutationRootExists.html @@ -0,0 +1,189 @@ + + + + + + + Module: GraphQL::StaticValidation::MutationRootExists + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::MutationRootExists + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/mutation_root_exists.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_operation_definition(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/mutation_root_exists.rb', line 5
+
+def on_operation_definition(node, _parent)
+  if node.operation_type == 'mutation' && context.warden.root_type_for_operation("mutation").nil?
+    add_error(GraphQL::StaticValidation::MutationRootExistsError.new(
+      'Schema is not configured for mutations',
+      nodes: node
+    ))
+  else
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/MutationRootExistsError.html b/api-doc/2.1.6/GraphQL/StaticValidation/MutationRootExistsError.html new file mode 100644 index 0000000000..0da2a8d767 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/MutationRootExistsError.html @@ -0,0 +1,348 @@ + + + + + + + Class: GraphQL::StaticValidation::MutationRootExistsError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::MutationRootExistsError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/mutation_root_exists_error.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: []) ⇒ MutationRootExistsError + + + + + +

+
+

Returns a new instance of MutationRootExistsError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/mutation_root_exists_error.rb', line 6
+
+def initialize(message, path: nil, nodes: [])
+  super(message, path: path, nodes: nodes)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'lib/graphql/static_validation/rules/mutation_root_exists_error.rb', line 21
+
+def code
+  "missingMutationConfiguration"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
+
# File 'lib/graphql/static_validation/rules/mutation_root_exists_error.rb', line 11
+
+def to_h
+  extensions = {
+    "code" => code,
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/NoDefinitionsArePresent.html b/api-doc/2.1.6/GraphQL/StaticValidation/NoDefinitionsArePresent.html new file mode 100644 index 0000000000..a928fa759f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/NoDefinitionsArePresent.html @@ -0,0 +1,313 @@ + + + + + + + Module: GraphQL::StaticValidation::NoDefinitionsArePresent + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::NoDefinitionsArePresent + + + +

+
+ + + + + + +
+
Includes:
+
Error::ErrorHelper
+
+ + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/no_definitions_are_present.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ +
    + +
  • + + + #initialize ⇒ Object + + + + + + + + + + + + + +
    +
    + +
  • + + +
  • + + + #on_document(node, parent) ⇒ Object + + + + + + + + + + + + + +
    +
    + +
  • + + +
  • + + + #on_invalid_node(node, parent) ⇒ Object + + + + (also: #on_directive_definition, #on_schema_definition, #on_scalar_type_definition, #on_object_type_definition, #on_input_object_type_definition, #on_interface_type_definition, #on_union_type_definition, #on_enum_type_definition, #on_schema_extension, #on_scalar_type_extension, #on_object_type_extension, #on_input_object_type_extension, #on_interface_type_extension, #on_union_type_extension, #on_enum_type_extension) + + + + + + + + + + + +
    +
    + +
  • + + +
+ + + + + + + + + + + +

Methods included from Error::ErrorHelper

+

#error

+ + +
+

Instance Method Details

+ + +
+

+ + #initializeObject + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/no_definitions_are_present.rb', line 7
+
+def initialize(*)
+  super
+  @schema_definition_nodes = []
+end
+
+
+ +
+

+ + #on_document(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+33
+34
+35
+36
+37
+38
+
+
# File 'lib/graphql/static_validation/rules/no_definitions_are_present.rb', line 33
+
+def on_document(node, parent)
+  super
+  if @schema_definition_nodes.any?
+    add_error(GraphQL::StaticValidation::NoDefinitionsArePresentError.new(%|Query cannot contain schema definitions|, nodes: @schema_definition_nodes))
+  end
+end
+
+
+ +
+

+ + #on_invalid_node(node, parent) ⇒ Object + + + + Also known as: + on_directive_definition, on_schema_definition, on_scalar_type_definition, on_object_type_definition, on_input_object_type_definition, on_interface_type_definition, on_union_type_definition, on_enum_type_definition, on_schema_extension, on_scalar_type_extension, on_object_type_extension, on_input_object_type_extension, on_interface_type_extension, on_union_type_extension, on_enum_type_extension + + + + +

+ + + + +
+
+
+
+12
+13
+14
+15
+
+
# File 'lib/graphql/static_validation/rules/no_definitions_are_present.rb', line 12
+
+def on_invalid_node(node, parent)
+  @schema_definition_nodes << node
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/NoDefinitionsArePresentError.html b/api-doc/2.1.6/GraphQL/StaticValidation/NoDefinitionsArePresentError.html new file mode 100644 index 0000000000..dd186bfaf9 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/NoDefinitionsArePresentError.html @@ -0,0 +1,348 @@ + + + + + + + Class: GraphQL::StaticValidation::NoDefinitionsArePresentError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::NoDefinitionsArePresentError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/no_definitions_are_present_error.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: []) ⇒ NoDefinitionsArePresentError + + + + + +

+
+

Returns a new instance of NoDefinitionsArePresentError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/no_definitions_are_present_error.rb', line 5
+
+def initialize(message, path: nil, nodes: [])
+  super(message, path: path, nodes: nodes)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/no_definitions_are_present_error.rb', line 20
+
+def code
+  "queryContainsSchemaDefinitions"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/rules/no_definitions_are_present_error.rb', line 10
+
+def to_h
+  extensions = {
+    "code" => code,
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/OneOfInputObjectsAreValid.html b/api-doc/2.1.6/GraphQL/StaticValidation/OneOfInputObjectsAreValid.html new file mode 100644 index 0000000000..398ad69908 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/OneOfInputObjectsAreValid.html @@ -0,0 +1,187 @@ + + + + + + + Module: GraphQL::StaticValidation::OneOfInputObjectsAreValid + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::OneOfInputObjectsAreValid + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_input_object(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
+
# File 'lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb', line 5
+
+def on_input_object(node, parent)
+  return super unless parent.is_a?(GraphQL::Language::Nodes::Argument)
+
+  parent_type = get_parent_type(context, parent)
+  return super unless parent_type && parent_type.kind.input_object? && parent_type.one_of?
+
+  validate_one_of_input_object(node, context, parent_type)
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/OneOfInputObjectsAreValidError.html b/api-doc/2.1.6/GraphQL/StaticValidation/OneOfInputObjectsAreValidError.html new file mode 100644 index 0000000000..77a8e1479e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/OneOfInputObjectsAreValidError.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::StaticValidation::OneOfInputObjectsAreValidError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::OneOfInputObjectsAreValidError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #input_object_type ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute input_object_type.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path:, nodes:, input_object_type:) ⇒ OneOfInputObjectsAreValidError + + + + + +

+
+

Returns a new instance of OneOfInputObjectsAreValidError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb', line 7
+
+def initialize(message, path:, nodes:, input_object_type:)
+  super(message, path: path, nodes: nodes)
+  @input_object_type = input_object_type
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #input_object_typeObject (readonly) + + + + + +

+
+

Returns the value of attribute input_object_type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb', line 5
+
+def input_object_type
+  @input_object_type
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb', line 24
+
+def code
+  "invalidOneOfInputObject"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/one_of_input_objects_are_valid_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code,
+    "inputObjectType" => input_object_type
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/OperationNamesAreValid.html b/api-doc/2.1.6/GraphQL/StaticValidation/OperationNamesAreValid.html new file mode 100644 index 0000000000..ca12c3a8ec --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/OperationNamesAreValid.html @@ -0,0 +1,317 @@ + + + + + + + Module: GraphQL::StaticValidation::OperationNamesAreValid + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::OperationNamesAreValid + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/operation_names_are_valid.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #initializeObject + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/operation_names_are_valid.rb', line 5
+
+def initialize(*)
+  super
+  @operation_names = Hash.new { |h, k| h[k] = [] }
+end
+
+
+ +
+

+ + #on_document(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
+
# File 'lib/graphql/static_validation/rules/operation_names_are_valid.rb', line 15
+
+def on_document(node, parent)
+  super
+  op_count = @operation_names.values.inject(0) { |m, v| m + v.size }
+
+  @operation_names.each do |name, nodes|
+    if name.nil? && op_count > 1
+      add_error(GraphQL::StaticValidation::OperationNamesAreValidError.new(
+        %|Operation name is required when multiple operations are present|,
+        nodes: nodes
+      ))
+    elsif nodes.length > 1
+      add_error(GraphQL::StaticValidation::OperationNamesAreValidError.new(
+        %|Operation name "#{name}" must be unique|,
+        nodes: nodes,
+        name: name
+      ))
+    end
+  end
+end
+
+
+ +
+

+ + #on_operation_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+10
+11
+12
+13
+
+
# File 'lib/graphql/static_validation/rules/operation_names_are_valid.rb', line 10
+
+def on_operation_definition(node, parent)
+  @operation_names[node.name] << node
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/OperationNamesAreValidError.html b/api-doc/2.1.6/GraphQL/StaticValidation/OperationNamesAreValidError.html new file mode 100644 index 0000000000..77720045a7 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/OperationNamesAreValidError.html @@ -0,0 +1,430 @@ + + + + + + + Class: GraphQL::StaticValidation::OperationNamesAreValidError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::OperationNamesAreValidError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/operation_names_are_valid_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #operation_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute operation_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], name: nil) ⇒ OperationNamesAreValidError + + + + + +

+
+

Returns a new instance of OperationNamesAreValidError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/operation_names_are_valid_error.rb', line 7
+
+def initialize(message, path: nil, nodes: [], name: nil)
+  super(message, path: path, nodes: nodes)
+  @operation_name = name
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #operation_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute operation_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/operation_names_are_valid_error.rb', line 5
+
+def operation_name
+  @operation_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+23
+24
+25
+
+
# File 'lib/graphql/static_validation/rules/operation_names_are_valid_error.rb', line 23
+
+def code
+  "uniquelyNamedOperations"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/static_validation/rules/operation_names_are_valid_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code
+  }.tap { |h| h["operationName"] = operation_name unless operation_name.nil? }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/QueryRootExists.html b/api-doc/2.1.6/GraphQL/StaticValidation/QueryRootExists.html new file mode 100644 index 0000000000..159618acff --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/QueryRootExists.html @@ -0,0 +1,189 @@ + + + + + + + Module: GraphQL::StaticValidation::QueryRootExists + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::QueryRootExists + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/query_root_exists.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_operation_definition(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/query_root_exists.rb', line 5
+
+def on_operation_definition(node, _parent)
+  if (node.operation_type == 'query' || node.operation_type.nil?) && context.warden.root_type_for_operation("query").nil?
+    add_error(GraphQL::StaticValidation::QueryRootExistsError.new(
+      'Schema is not configured for queries',
+      nodes: node
+    ))
+  else
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/QueryRootExistsError.html b/api-doc/2.1.6/GraphQL/StaticValidation/QueryRootExistsError.html new file mode 100644 index 0000000000..5290a29db5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/QueryRootExistsError.html @@ -0,0 +1,348 @@ + + + + + + + Class: GraphQL::StaticValidation::QueryRootExistsError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::QueryRootExistsError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/query_root_exists_error.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: []) ⇒ QueryRootExistsError + + + + + +

+
+

Returns a new instance of QueryRootExistsError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/query_root_exists_error.rb', line 6
+
+def initialize(message, path: nil, nodes: [])
+  super(message, path: path, nodes: nodes)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'lib/graphql/static_validation/rules/query_root_exists_error.rb', line 21
+
+def code
+  "missingQueryConfiguration"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
+
# File 'lib/graphql/static_validation/rules/query_root_exists_error.rb', line 11
+
+def to_h
+  extensions = {
+    "code" => code,
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/RequiredArgumentsArePresent.html b/api-doc/2.1.6/GraphQL/StaticValidation/RequiredArgumentsArePresent.html new file mode 100644 index 0000000000..e2d5572b3f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/RequiredArgumentsArePresent.html @@ -0,0 +1,234 @@ + + + + + + + Module: GraphQL::StaticValidation::RequiredArgumentsArePresent + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::RequiredArgumentsArePresent + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/required_arguments_are_present.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_directive(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/required_arguments_are_present.rb', line 10
+
+def on_directive(node, _parent)
+  directive_defn = context.schema_directives[node.name]
+  assert_required_args(node, directive_defn)
+  super
+end
+
+
+ +
+

+ + #on_field(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/required_arguments_are_present.rb', line 5
+
+def on_field(node, _parent)
+  assert_required_args(node, field_definition)
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/RequiredArgumentsArePresentError.html b/api-doc/2.1.6/GraphQL/StaticValidation/RequiredArgumentsArePresentError.html new file mode 100644 index 0000000000..f95b2fd4e1 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/RequiredArgumentsArePresentError.html @@ -0,0 +1,580 @@ + + + + + + + Class: GraphQL::StaticValidation::RequiredArgumentsArePresentError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::RequiredArgumentsArePresentError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/required_arguments_are_present_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #arguments ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute arguments.

    +
    + +
  • + + +
  • + + + #class_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute class_name.

    +
    + +
  • + + +
  • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], class_name:, name:, arguments:) ⇒ RequiredArgumentsArePresentError + + + + + +

+
+

Returns a new instance of RequiredArgumentsArePresentError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/required_arguments_are_present_error.rb', line 9
+
+def initialize(message, path: nil, nodes: [], class_name:, name:, arguments:)
+  super(message, path: path, nodes: nodes)
+  @class_name = class_name
+  @name = name
+  @arguments = arguments
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argumentsObject (readonly) + + + + + +

+
+

Returns the value of attribute arguments.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/static_validation/rules/required_arguments_are_present_error.rb', line 7
+
+def arguments
+  @arguments
+end
+
+
+ + + +
+

+ + #class_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute class_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/required_arguments_are_present_error.rb', line 5
+
+def class_name
+  @class_name
+end
+
+
+ + + +
+

+ + #nameObject (readonly) + + + + + +

+
+

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/required_arguments_are_present_error.rb', line 6
+
+def name
+  @name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/static_validation/rules/required_arguments_are_present_error.rb', line 30
+
+def code
+  "missingRequiredArguments"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/static_validation/rules/required_arguments_are_present_error.rb', line 17
+
+def to_h
+  extensions = {
+    "code" => code,
+    "className" => class_name,
+    "name" => name,
+    "arguments" => arguments
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/RequiredInputObjectAttributesArePresent.html b/api-doc/2.1.6/GraphQL/StaticValidation/RequiredInputObjectAttributesArePresent.html new file mode 100644 index 0000000000..9b275bc27d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/RequiredInputObjectAttributesArePresent.html @@ -0,0 +1,181 @@ + + + + + + + Module: GraphQL::StaticValidation::RequiredInputObjectAttributesArePresent + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::RequiredInputObjectAttributesArePresent + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_input_object(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb', line 5
+
+def on_input_object(node, parent)
+  if parent.is_a? GraphQL::Language::Nodes::Argument
+    validate_input_object(node, context, parent)
+  end
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/RequiredInputObjectAttributesArePresentError.html b/api-doc/2.1.6/GraphQL/StaticValidation/RequiredInputObjectAttributesArePresentError.html new file mode 100644 index 0000000000..95c1693324 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/RequiredInputObjectAttributesArePresentError.html @@ -0,0 +1,580 @@ + + + + + + + Class: GraphQL::StaticValidation::RequiredInputObjectAttributesArePresentError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::RequiredInputObjectAttributesArePresentError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #argument_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute argument_name.

    +
    + +
  • + + +
  • + + + #argument_type ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute argument_type.

    +
    + +
  • + + +
  • + + + #input_object_type ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute input_object_type.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path:, nodes:, argument_type:, argument_name:, input_object_type:) ⇒ RequiredInputObjectAttributesArePresentError + + + + + +

+
+

Returns a new instance of RequiredInputObjectAttributesArePresentError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb', line 9
+
+def initialize(message, path:, nodes:, argument_type:, argument_name:, input_object_type:)
+  super(message, path: path, nodes: nodes)
+  @argument_type = argument_type
+  @argument_name = argument_name
+  @input_object_type = input_object_type
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argument_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute argument_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb', line 6
+
+def argument_name
+  @argument_name
+end
+
+
+ + + +
+

+ + #argument_typeObject (readonly) + + + + + +

+
+

Returns the value of attribute argument_type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb', line 5
+
+def argument_type
+  @argument_type
+end
+
+
+ + + +
+

+ + #input_object_typeObject (readonly) + + + + + +

+
+

Returns the value of attribute input_object_type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb', line 7
+
+def input_object_type
+  @input_object_type
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb', line 30
+
+def code
+  "missingRequiredInputObjectAttribute"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb', line 17
+
+def to_h
+  extensions = {
+    "code" => code,
+    "argumentName" => argument_name,
+    "argumentType" => argument_type,
+    "inputObjectType" => input_object_type,
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/SubscriptionRootExists.html b/api-doc/2.1.6/GraphQL/StaticValidation/SubscriptionRootExists.html new file mode 100644 index 0000000000..5233e07794 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/SubscriptionRootExists.html @@ -0,0 +1,189 @@ + + + + + + + Module: GraphQL::StaticValidation::SubscriptionRootExists + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::SubscriptionRootExists + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/subscription_root_exists.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_operation_definition(node, _parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/subscription_root_exists.rb', line 5
+
+def on_operation_definition(node, _parent)
+  if node.operation_type == "subscription" && context.warden.root_type_for_operation("subscription").nil?
+    add_error(GraphQL::StaticValidation::SubscriptionRootExistsError.new(
+      'Schema is not configured for subscriptions',
+      nodes: node
+    ))
+  else
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/SubscriptionRootExistsError.html b/api-doc/2.1.6/GraphQL/StaticValidation/SubscriptionRootExistsError.html new file mode 100644 index 0000000000..d3e2f8be11 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/SubscriptionRootExistsError.html @@ -0,0 +1,348 @@ + + + + + + + Class: GraphQL::StaticValidation::SubscriptionRootExistsError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::SubscriptionRootExistsError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/subscription_root_exists_error.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: []) ⇒ SubscriptionRootExistsError + + + + + +

+
+

Returns a new instance of SubscriptionRootExistsError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/subscription_root_exists_error.rb', line 6
+
+def initialize(message, path: nil, nodes: [])
+  super(message, path: path, nodes: nodes)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'lib/graphql/static_validation/rules/subscription_root_exists_error.rb', line 21
+
+def code
+  "missingSubscriptionConfiguration"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
+
# File 'lib/graphql/static_validation/rules/subscription_root_exists_error.rb', line 11
+
+def to_h
+  extensions = {
+    "code" => code,
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/UniqueDirectivesPerLocation.html b/api-doc/2.1.6/GraphQL/StaticValidation/UniqueDirectivesPerLocation.html new file mode 100644 index 0000000000..0f68e65f6e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/UniqueDirectivesPerLocation.html @@ -0,0 +1,136 @@ + + + + + + + Module: GraphQL::StaticValidation::UniqueDirectivesPerLocation + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::UniqueDirectivesPerLocation + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/unique_directives_per_location.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
DIRECTIVE_NODE_HOOKS = + +
+
[
+  :on_fragment_definition,
+  :on_fragment_spread,
+  :on_inline_fragment,
+  :on_operation_definition,
+  :on_scalar_type_definition,
+  :on_object_type_definition,
+  :on_input_value_definition,
+  :on_field_definition,
+  :on_interface_type_definition,
+  :on_union_type_definition,
+  :on_enum_type_definition,
+  :on_enum_value_definition,
+  :on_input_object_type_definition,
+  :on_field,
+]
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/UniqueDirectivesPerLocationError.html b/api-doc/2.1.6/GraphQL/StaticValidation/UniqueDirectivesPerLocationError.html new file mode 100644 index 0000000000..8a6f9c1b80 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/UniqueDirectivesPerLocationError.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::StaticValidation::UniqueDirectivesPerLocationError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::UniqueDirectivesPerLocationError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/unique_directives_per_location_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #directive_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute directive_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], directive:) ⇒ UniqueDirectivesPerLocationError + + + + + +

+
+

Returns a new instance of UniqueDirectivesPerLocationError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/unique_directives_per_location_error.rb', line 7
+
+def initialize(message, path: nil, nodes: [], directive:)
+  super(message, path: path, nodes: nodes)
+  @directive_name = directive
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #directive_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute directive_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/unique_directives_per_location_error.rb', line 5
+
+def directive_name
+  @directive_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/unique_directives_per_location_error.rb', line 24
+
+def code
+  "directiveNotUniqueForLocation"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/unique_directives_per_location_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code,
+    "directiveName" => directive_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/ValidationContext.html b/api-doc/2.1.6/GraphQL/StaticValidation/ValidationContext.html new file mode 100644 index 0000000000..865a2f822a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/ValidationContext.html @@ -0,0 +1,978 @@ + + + + + + + Class: GraphQL::StaticValidation::ValidationContext + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::ValidationContext + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/validation_context.rb
+
+ +
+ +

Overview

+
+

The validation context gets passed to each validator.

+ +

It exposes a Language::Visitor where validators may add hooks. (Language::Visitor#visit is called in GraphQL::StaticValidation::Validator#validate)

+ +

It provides access to the schema & fragments which validators may read from.

+ +

It holds a list of errors which each validator may add to.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #errors ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute errors.

    +
    + +
  • + + +
  • + + + #max_errors ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute max_errors.

    +
    + +
  • + + +
  • + + + #on_dependency_resolve_handlers ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute on_dependency_resolve_handlers.

    +
    + +
  • + + +
  • + + + #query ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute query.

    +
    + +
  • + + +
  • + + + #schema ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute schema.

    +
    + +
  • + + +
  • + + + #visitor ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute visitor.

    +
    + +
  • + + +
  • + + + #warden ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute warden.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initialize(query, visitor_class, max_errors) ⇒ ValidationContext + + + + + +

+
+

Returns a new instance of ValidationContext.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 21
+
+def initialize(query, visitor_class, max_errors)
+  @query = query
+  @warden = query.warden
+  @schema = query.schema
+  @literal_validator = LiteralValidator.new(context: query.context)
+  @errors = []
+  @max_errors = max_errors || Float::INFINITY
+  @on_dependency_resolve_handlers = []
+  @visitor = visitor_class.new(document, self)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #errorsObject (readonly) + + + + + +

+
+

Returns the value of attribute errors.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 14
+
+def errors
+  @errors
+end
+
+
+ + + +
+

+ + #max_errorsObject (readonly) + + + + + +

+
+

Returns the value of attribute max_errors.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 14
+
+def max_errors
+  @max_errors
+end
+
+
+ + + +
+

+ + #on_dependency_resolve_handlersObject (readonly) + + + + + +

+
+

Returns the value of attribute on_dependency_resolve_handlers.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 14
+
+def on_dependency_resolve_handlers
+  @on_dependency_resolve_handlers
+end
+
+
+ + + +
+

+ + #queryObject (readonly) + + + + + +

+
+

Returns the value of attribute query.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 14
+
+def query
+  @query
+end
+
+
+ + + +
+

+ + #schemaObject (readonly) + + + + + +

+
+

Returns the value of attribute schema.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 14
+
+def schema
+  @schema
+end
+
+
+ + + +
+

+ + #visitorObject (readonly) + + + + + +

+
+

Returns the value of attribute visitor.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 14
+
+def visitor
+  @visitor
+end
+
+
+ + + +
+

+ + #wardenObject (readonly) + + + + + +

+
+

Returns the value of attribute warden.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 14
+
+def warden
+  @warden
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #on_dependency_resolve(&handler) ⇒ Object + + + + + +

+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 36
+
+def on_dependency_resolve(&handler)
+  @on_dependency_resolve_handlers << handler
+end
+
+
+ +
+

+ + #schema_directivesObject + + + + + +

+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 48
+
+def schema_directives
+  @schema_directives ||= schema.directives
+end
+
+
+ +
+

+ + #too_many_errors?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 44
+
+def too_many_errors?
+  @errors.length >= @max_errors
+end
+
+
+ +
+

+ + #validate_literal(ast_value, type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+40
+41
+42
+
+
# File 'lib/graphql/static_validation/validation_context.rb', line 40
+
+def validate_literal(ast_value, type)
+  @literal_validator.validate(ast_value, type)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/ValidationTimeoutError.html b/api-doc/2.1.6/GraphQL/StaticValidation/ValidationTimeoutError.html new file mode 100644 index 0000000000..53597c3a87 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/ValidationTimeoutError.html @@ -0,0 +1,348 @@ + + + + + + + Class: GraphQL::StaticValidation::ValidationTimeoutError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::ValidationTimeoutError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/validation_timeout_error.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: []) ⇒ ValidationTimeoutError + + + + + +

+
+

Returns a new instance of ValidationTimeoutError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/validation_timeout_error.rb', line 5
+
+def initialize(message, path: nil, nodes: [])
+  super(message, path: path, nodes: nodes)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/validation_timeout_error.rb', line 20
+
+def code
+  "validationTimeout"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/validation_timeout_error.rb', line 10
+
+def to_h
+  extensions = {
+    "code" => code
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/Validator.html b/api-doc/2.1.6/GraphQL/StaticValidation/Validator.html new file mode 100644 index 0000000000..176ba75ff3 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/Validator.html @@ -0,0 +1,559 @@ + + + + + + + Class: GraphQL::StaticValidation::Validator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::Validator + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/validator.rb
+
+ +
+ +

Overview

+
+

Initialized with a GraphQL::Schema, then it can validate Language::Nodes::Documentss based on that schema.

+ +

By default, it’s used by Query

+ + +
+
+
+ +
+

Examples:

+ + +

Validate a query

+

+ +
validator = GraphQL::StaticValidation::Validator.new(schema: MySchema)
+query = GraphQL::Query.new(MySchema, query_string)
+errors = validator.validate(query)[:errors]
+ +
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(schema:, rules: GraphQL::StaticValidation::ALL_RULES) ⇒ Validator + + + + + +

+
+

Returns a new instance of Validator.

+ + +
+
+
+

Parameters:

+
    + +
  • + + schema + + + (GraphQL::Schema) + + + +
  • + +
  • + + rules + + + (Array<#validate(context)>) + + + (defaults to: GraphQL::StaticValidation::ALL_RULES) + + + — +

    a list of rules to use when validating

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+18
+19
+20
+21
+
+
# File 'lib/graphql/static_validation/validator.rb', line 18
+
+def initialize(schema:, rules: GraphQL::StaticValidation::ALL_RULES)
+  @schema = schema
+  @rules = rules
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #handle_timeout(query, context) ⇒ Object + + + + + +

+
+

Invoked when static validation times out.

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+67
+68
+69
+70
+71
+
+
# File 'lib/graphql/static_validation/validator.rb', line 67
+
+def handle_timeout(query, context)
+  context.errors << GraphQL::StaticValidation::ValidationTimeoutError.new(
+    "Timeout on validation of query"
+  )
+end
+
+
+ +
+

+ + #validate(query, validate: true, timeout: nil, max_errors: nil) ⇒ Array<Hash> + + + + + +

+
+

Validate query against the schema. Returns an array of message hashes.

+ + +
+
+
+

Parameters:

+
    + +
  • + + query + + + (GraphQL::Query) + + + +
  • + +
  • + + validate + + + (Boolean) + + + (defaults to: true) + + +
  • + +
  • + + timeout + + + (Float) + + + (defaults to: nil) + + + — +

    Number of seconds to wait before aborting validation. Any positive number may be used, including Floats to specify fractional seconds.

    +
    + +
  • + +
  • + + max_errors + + + (Integer) + + + (defaults to: nil) + + + — +

    Maximum number of errors before aborting validation. Any positive number will limit the number of errors. Defaults to nil for no limit.

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Array<Hash>) + + + +
  • + +
+ +
+ + + + +
+
+
+
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+
+
# File 'lib/graphql/static_validation/validator.rb', line 29
+
+def validate(query, validate: true, timeout: nil, max_errors: nil)
+  query.current_trace.validate(validate: validate, query: query) do
+    errors = if validate == false
+      []
+    else
+      rules_to_use = validate ? @rules : []
+      visitor_class = BaseVisitor.including_rules(rules_to_use)
+
+      context = GraphQL::StaticValidation::ValidationContext.new(query, visitor_class, max_errors)
+
+      begin
+        # CAUTION: Usage of the timeout module makes the assumption that validation rules are stateless Ruby code that requires no cleanup if process was interrupted. This means no blocking IO calls, native gems, locks, or `rescue` clauses that must be reached.
+        # A timeout value of 0 or nil will execute the block without any timeout.
+        Timeout::timeout(timeout) do
+          catch(:too_many_validation_errors) do
+            context.visitor.visit
+          end
+        end
+      rescue Timeout::Error
+        handle_timeout(query, context)
+      end
+
+      context.errors
+    end
+
+    {
+      errors: errors,
+    }
+  end
+rescue GraphQL::ExecutionError => e
+  {
+    errors: [e],
+  }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariableDefaultValuesAreCorrectlyTyped.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariableDefaultValuesAreCorrectlyTyped.html new file mode 100644 index 0000000000..2f3bf64538 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariableDefaultValuesAreCorrectlyTyped.html @@ -0,0 +1,247 @@ + + + + + + + Module: GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTyped + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTyped + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_variable_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
+
# File 'lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb', line 5
+
+def on_variable_definition(node, parent)
+  if !node.default_value.nil?
+    value = node.default_value
+    if node.type.is_a?(GraphQL::Language::Nodes::NonNullType)
+      add_error(GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError.new(
+        "Non-null variable $#{node.name} can't have a default value",
+        nodes: node,
+        name: node.name,
+        error_type: VariableDefaultValuesAreCorrectlyTypedError::VIOLATIONS[:INVALID_ON_NON_NULL]
+      ))
+    else
+      type = context.schema.type_from_ast(node.type, context: context)
+      if type.nil?
+        # This is handled by another validator
+      else
+        validation_result = context.validate_literal(value, type)
+
+        if !validation_result.valid?
+          problems = validation_result.problems
+          first_problem = problems && problems.first
+          if first_problem
+            error_message = first_problem["explanation"]
+          end
+
+          error_message ||= "Default value for $#{node.name} doesn't match type #{type.to_type_signature}"
+          add_error(GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError.new(
+            error_message,
+            nodes: node,
+            name: node.name,
+            type: type.to_type_signature,
+            error_type: VariableDefaultValuesAreCorrectlyTypedError::VIOLATIONS[:INVALID_TYPE],
+          ))
+        end
+      end
+    end
+  end
+
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariableDefaultValuesAreCorrectlyTypedError.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariableDefaultValuesAreCorrectlyTypedError.html new file mode 100644 index 0000000000..0ecf20714b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariableDefaultValuesAreCorrectlyTypedError.html @@ -0,0 +1,597 @@ + + + + + + + Class: GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
VIOLATIONS = + +
+
{
+  :INVALID_TYPE         => "defaultValueInvalidType",
+  :INVALID_ON_NON_NULL  => "defaultValueInvalidOnNonNullVariable",
+}
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #type_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type_name.

    +
    + +
  • + + +
  • + + + #variable_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute variable_name.

    +
    + +
  • + + +
  • + + + #violation ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute violation.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], name:, type: nil, error_type:) ⇒ VariableDefaultValuesAreCorrectlyTypedError + + + + + +

+
+

Returns a new instance of VariableDefaultValuesAreCorrectlyTypedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+14
+15
+16
+17
+18
+19
+20
+
+
# File 'lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb', line 14
+
+def initialize(message, path: nil, nodes: [], name:, type: nil, error_type:)
+  super(message, path: path, nodes: nodes)
+  @variable_name = name
+  @type_name = type
+  raise("Unexpected error type: #{error_type}") if !VIOLATIONS.values.include?(error_type)
+  @violation = error_type
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #type_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute type_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb', line 6
+
+def type_name
+  @type_name
+end
+
+
+ + + +
+

+ + #variable_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute variable_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb', line 5
+
+def variable_name
+  @variable_name
+end
+
+
+ + + +
+

+ + #violationObject (readonly) + + + + + +

+
+

Returns the value of attribute violation.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb', line 7
+
+def violation
+  @violation
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb', line 34
+
+def code
+  @violation
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
+
# File 'lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb', line 23
+
+def to_h
+  extensions = {
+    "code" => code,
+    "variableName" => variable_name
+  }.tap { |h| h["typeName"] = type_name unless type_name.nil? }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariableNamesAreUnique.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariableNamesAreUnique.html new file mode 100644 index 0000000000..a95bf61982 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariableNamesAreUnique.html @@ -0,0 +1,203 @@ + + + + + + + Module: GraphQL::StaticValidation::VariableNamesAreUnique + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::VariableNamesAreUnique + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variable_names_are_unique.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_operation_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/static_validation/rules/variable_names_are_unique.rb', line 5
+
+def on_operation_definition(node, parent)
+  var_defns = node.variables
+  if var_defns.any?
+    vars_by_name = Hash.new { |h, k| h[k] = [] }
+    var_defns.each { |v| vars_by_name[v.name] << v }
+    vars_by_name.each do |name, defns|
+      if defns.size > 1
+        add_error(GraphQL::StaticValidation::VariableNamesAreUniqueError.new(
+          "There can only be one variable named \"#{name}\"",
+          nodes: defns,
+          name: name
+        ))
+      end
+    end
+  end
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariableNamesAreUniqueError.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariableNamesAreUniqueError.html new file mode 100644 index 0000000000..1a0d5c0935 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariableNamesAreUniqueError.html @@ -0,0 +1,432 @@ + + + + + + + Class: GraphQL::StaticValidation::VariableNamesAreUniqueError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::VariableNamesAreUniqueError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variable_names_are_unique_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #variable_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute variable_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], name:) ⇒ VariableNamesAreUniqueError + + + + + +

+
+

Returns a new instance of VariableNamesAreUniqueError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/variable_names_are_unique_error.rb', line 7
+
+def initialize(message, path: nil, nodes: [], name:)
+  super(message, path: path, nodes: nodes)
+  @variable_name = name
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #variable_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute variable_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/variable_names_are_unique_error.rb', line 5
+
+def variable_name
+  @variable_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/variable_names_are_unique_error.rb', line 24
+
+def code
+  "variableNotUnique"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
+
# File 'lib/graphql/static_validation/rules/variable_names_are_unique_error.rb', line 13
+
+def to_h
+  extensions = {
+    "code" => code,
+    "variableName" => variable_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariableUsagesAreAllowed.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariableUsagesAreAllowed.html new file mode 100644 index 0000000000..a2595d7f7a --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariableUsagesAreAllowed.html @@ -0,0 +1,351 @@ + + + + + + + Module: GraphQL::StaticValidation::VariableUsagesAreAllowed + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::VariableUsagesAreAllowed + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variable_usages_are_allowed.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #initializeObject + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+
+
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed.rb', line 5
+
+def initialize(*)
+  super
+  # holds { name => ast_node } pairs
+  @declared_variables = {}
+end
+
+
+ +
+

+ + #on_argument(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
+
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed.rb', line 16
+
+def on_argument(node, parent)
+  node_values = if node.value.is_a?(Array)
+    node.value
+  else
+    [node.value]
+  end
+  node_values = node_values.select { |value| value.is_a? GraphQL::Language::Nodes::VariableIdentifier }
+
+  if node_values.any?
+    argument_owner = case parent
+    when GraphQL::Language::Nodes::Field
+      context.field_definition
+    when GraphQL::Language::Nodes::Directive
+      context.directive_definition
+    when GraphQL::Language::Nodes::InputObject
+      arg_type = context.argument_definition.type.unwrap
+      if arg_type.kind.input_object?
+        arg_type
+      else
+        # This is some kind of error
+        nil
+      end
+    else
+      raise("Unexpected argument parent: #{parent}")
+    end
+
+    node_values.each do |node_value|
+      var_defn_ast = @declared_variables[node_value.name]
+      # Might be undefined :(
+      # VariablesAreUsedAndDefined can't finalize its search until the end of the document.
+      var_defn_ast && argument_owner && validate_usage(argument_owner, node, var_defn_ast)
+    end
+  end
+  super
+end
+
+
+ +
+

+ + #on_operation_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+11
+12
+13
+14
+
+
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed.rb', line 11
+
+def on_operation_definition(node, parent)
+  @declared_variables = node.variables.each_with_object({}) { |var, memo| memo[var.name] = var }
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariableUsagesAreAllowedError.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariableUsagesAreAllowedError.html new file mode 100644 index 0000000000..63f24b57fc --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariableUsagesAreAllowedError.html @@ -0,0 +1,654 @@ + + + + + + + Class: GraphQL::StaticValidation::VariableUsagesAreAllowedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::VariableUsagesAreAllowedError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #argument_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute argument_name.

    +
    + +
  • + + +
  • + + + #error_message ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute error_message.

    +
    + +
  • + + +
  • + + + #type_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type_name.

    +
    + +
  • + + +
  • + + + #variable_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute variable_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], type:, name:, argument:, error:) ⇒ VariableUsagesAreAllowedError + + + + + +

+
+

Returns a new instance of VariableUsagesAreAllowedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+10
+11
+12
+13
+14
+15
+16
+
+
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 10
+
+def initialize(message, path: nil, nodes: [], type:, name:, argument:, error:)
+  super(message, path: path, nodes: nodes)
+  @type_name = type
+  @variable_name = name
+  @argument_name = argument
+  @error_message = error
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argument_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute argument_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 7
+
+def argument_name
+  @argument_name
+end
+
+
+ + + +
+

+ + #error_messageObject (readonly) + + + + + +

+
+

Returns the value of attribute error_message.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 8
+
+def error_message
+  @error_message
+end
+
+
+ + + +
+

+ + #type_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute type_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 5
+
+def type_name
+  @type_name
+end
+
+
+ + + +
+

+ + #variable_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute variable_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 6
+
+def variable_name
+  @variable_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 33
+
+def code
+  "variableMismatch"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
+
# File 'lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb', line 19
+
+def to_h
+  extensions = {
+    "code" => code,
+    "variableName" => variable_name,
+    "typeName" => type_name,
+    "argumentName" => argument_name,
+    "errorMessage" => error_message
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreInputTypes.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreInputTypes.html new file mode 100644 index 0000000000..acc5848b36 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreInputTypes.html @@ -0,0 +1,213 @@ + + + + + + + Module: GraphQL::StaticValidation::VariablesAreInputTypes + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::VariablesAreInputTypes + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variables_are_input_types.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #on_variable_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
+
# File 'lib/graphql/static_validation/rules/variables_are_input_types.rb', line 5
+
+def on_variable_definition(node, parent)
+  type_name = get_type_name(node.type)
+  type = context.warden.get_type(type_name)
+
+  if type.nil?
+    add_error(GraphQL::StaticValidation::VariablesAreInputTypesError.new(
+      "#{type_name} isn't a defined input type (on $#{node.name})",
+      nodes: node,
+      name: node.name,
+      type: type_name
+    ))
+  elsif !type.kind.input?
+    add_error(GraphQL::StaticValidation::VariablesAreInputTypesError.new(
+      "#{type.graphql_name} isn't a valid input type (on $#{node.name})",
+      nodes: node,
+      name: node.name,
+      type: type_name
+    ))
+  end
+
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreInputTypesError.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreInputTypesError.html new file mode 100644 index 0000000000..cdda1c0cc0 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreInputTypesError.html @@ -0,0 +1,506 @@ + + + + + + + Class: GraphQL::StaticValidation::VariablesAreInputTypesError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::VariablesAreInputTypesError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variables_are_input_types_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #type_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute type_name.

    +
    + +
  • + + +
  • + + + #variable_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute variable_name.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], type:, name:) ⇒ VariablesAreInputTypesError + + + + + +

+
+

Returns a new instance of VariablesAreInputTypesError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+
+
# File 'lib/graphql/static_validation/rules/variables_are_input_types_error.rb', line 8
+
+def initialize(message, path: nil, nodes: [], type:, name:)
+  super(message, path: path, nodes: nodes)
+  @type_name = type
+  @variable_name = name
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #type_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute type_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/variables_are_input_types_error.rb', line 5
+
+def type_name
+  @type_name
+end
+
+
+ + + +
+

+ + #variable_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute variable_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/variables_are_input_types_error.rb', line 6
+
+def variable_name
+  @variable_name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/graphql/static_validation/rules/variables_are_input_types_error.rb', line 27
+
+def code
+  "variableRequiresValidType"
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/static_validation/rules/variables_are_input_types_error.rb', line 15
+
+def to_h
+  extensions = {
+    "code" => code,
+    "typeName" => type_name,
+    "variableName" => variable_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefined.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefined.html new file mode 100644 index 0000000000..3907bde162 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefined.html @@ -0,0 +1,558 @@ + + + + + + + Module: GraphQL::StaticValidation::VariablesAreUsedAndDefined + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::StaticValidation::VariablesAreUsedAndDefined + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variables_are_used_and_defined.rb
+
+ +
+ +

Overview

+
+

The problem is + - Variable $usage must be determined at the OperationDefinition level + - You can’t tell how fragments use variables until you visit FragmentDefinitions (which may be at the end of the document)

+ +

So, this validator includes some crazy logic to follow fragment spreads recursively, while avoiding infinite loops.

+ +

graphql-js solves this problem by: + - re-visiting the AST for each validator + - allowing validators to say followSpreads: true

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: VariableUsage + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #initializeObject + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 26
+
+def initialize(*)
+  super
+  @variable_usages_for_context = Hash.new {|hash, key| hash[key] = Hash.new {|h, k| h[k] = VariableUsage.new } }
+  @spreads_for_context = Hash.new {|hash, key| hash[key] = [] }
+  @variable_context_stack = []
+end
+
+
+ +
+

+ + #on_document(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 78
+
+def on_document(node, parent)
+  super
+  fragment_definitions = @variable_usages_for_context.select { |key, value| key.is_a?(GraphQL::Language::Nodes::FragmentDefinition) }
+  operation_definitions = @variable_usages_for_context.select { |key, value| key.is_a?(GraphQL::Language::Nodes::OperationDefinition) }
+
+  operation_definitions.each do |node, node_variables|
+    follow_spreads(node, node_variables, @spreads_for_context, fragment_definitions, [])
+    create_errors(node_variables)
+  end
+end
+
+
+ +
+

+ + #on_fragment_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+48
+49
+50
+51
+52
+53
+54
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 48
+
+def on_fragment_definition(node, parent)
+  # initialize the hash of vars for this context:
+  @variable_usages_for_context[node]
+  @variable_context_stack.push(node)
+  super
+  @variable_context_stack.pop
+end
+
+
+ +
+

+ + #on_fragment_spread(node, parent) ⇒ Object + + + + + +

+
+

For FragmentSpreads: + - find the context on the stack + - mark the context as containing this spread

+ + +
+
+
+ + +
+ + + + +
+
+
+
+59
+60
+61
+62
+63
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 59
+
+def on_fragment_spread(node, parent)
+  variable_context = @variable_context_stack.last
+  @spreads_for_context[variable_context] << node.name
+  super
+end
+
+
+ +
+

+ + #on_operation_definition(node, parent) ⇒ Object + + + + + +

+ + + + +
+
+
+
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 33
+
+def on_operation_definition(node, parent)
+  # initialize the hash of vars for this context:
+  @variable_usages_for_context[node]
+  @variable_context_stack.push(node)
+  # mark variables as defined:
+  var_hash = @variable_usages_for_context[node]
+  node.variables.each { |var|
+    var_usage = var_hash[var.name]
+    var_usage.declared_by = node
+    var_usage.path = context.path
+  }
+  super
+  @variable_context_stack.pop
+end
+
+
+ +
+

+ + #on_variable_identifier(node, parent) ⇒ Object + + + + + +

+
+

For VariableIdentifiers: + - mark the variable as used + - assign its AST node

+ + +
+
+
+ + +
+ + + + +
+
+
+
+68
+69
+70
+71
+72
+73
+74
+75
+76
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 68
+
+def on_variable_identifier(node, parent)
+  usage_context = @variable_context_stack.last
+  declared_variables = @variable_usages_for_context[usage_context]
+  usage = declared_variables[node.name]
+  usage.used_by = usage_context
+  usage.ast_node = node
+  usage.path = context.path
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefined/VariableUsage.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefined/VariableUsage.html new file mode 100644 index 0000000000..7d8e25af16 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefined/VariableUsage.html @@ -0,0 +1,572 @@ + + + + + + + Class: GraphQL::StaticValidation::VariablesAreUsedAndDefined::VariableUsage + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::VariablesAreUsedAndDefined::VariableUsage + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variables_are_used_and_defined.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #ast_node ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute ast_node.

    +
    + +
  • + + +
  • + + + #declared_by ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute declared_by.

    +
    + +
  • + + +
  • + + + #path ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute path.

    +
    + +
  • + + +
  • + + + #used_by ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute used_by.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #ast_nodeObject + + + + + +

+
+

Returns the value of attribute ast_node.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 16
+
+def ast_node
+  @ast_node
+end
+
+
+ + + +
+

+ + #declared_byObject + + + + + +

+
+

Returns the value of attribute declared_by.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 16
+
+def declared_by
+  @declared_by
+end
+
+
+ + + +
+

+ + #pathObject + + + + + +

+
+

Returns the value of attribute path.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 16
+
+def path
+  @path
+end
+
+
+ + + +
+

+ + #used_byObject + + + + + +

+
+

Returns the value of attribute used_by.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 16
+
+def used_by
+  @used_by
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #declared?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 21
+
+def declared?
+  !!@declared_by
+end
+
+
+ +
+

+ + #used?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined.rb', line 17
+
+def used?
+  !!@used_by
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefinedError.html b/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefinedError.html new file mode 100644 index 0000000000..c2683e807b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StaticValidation/VariablesAreUsedAndDefinedError.html @@ -0,0 +1,525 @@ + + + + + + + Class: GraphQL::StaticValidation::VariablesAreUsedAndDefinedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::StaticValidation::VariablesAreUsedAndDefinedError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
VIOLATIONS = + +
+
{
+  :VARIABLE_NOT_USED     => "variableNotUsed",
+  :VARIABLE_NOT_DEFINED  => "variableNotDefined",
+}
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #variable_name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute variable_name.

    +
    + +
  • + + +
  • + + + #violation ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute violation.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from Error

+

#message, #nodes, #path

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message, path: nil, nodes: [], name:, error_type:) ⇒ VariablesAreUsedAndDefinedError + + + + + +

+
+

Returns a new instance of VariablesAreUsedAndDefinedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb', line 13
+
+def initialize(message, path: nil, nodes: [], name:, error_type:)
+  super(message, path: path, nodes: nodes)
+  @variable_name = name
+  raise("Unexpected error type: #{error_type}") if !VIOLATIONS.values.include?(error_type)
+  @violation = error_type
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #variable_nameObject (readonly) + + + + + +

+
+

Returns the value of attribute variable_name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb', line 5
+
+def variable_name
+  @variable_name
+end
+
+
+ + + +
+

+ + #violationObject (readonly) + + + + + +

+
+

Returns the value of attribute violation.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+6
+7
+8
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb', line 6
+
+def violation
+  @violation
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #codeObject + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb', line 32
+
+def code
+  @violation
+end
+
+
+ +
+

+ + #to_hObject + + + + + +

+
+

A hash representation of this Message

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
+
# File 'lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb', line 21
+
+def to_h
+  extensions = {
+    "code" => code,
+    "variableName" => variable_name
+  }
+
+  super.merge({
+    "extensions" => extensions
+  })
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/StringEncodingError.html b/api-doc/2.1.6/GraphQL/StringEncodingError.html new file mode 100644 index 0000000000..b7ab369452 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/StringEncodingError.html @@ -0,0 +1,462 @@ + + + + + + + Exception: GraphQL::StringEncodingError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::StringEncodingError + + + +

+
+ +
+
Inherits:
+
+ RuntimeTypeError + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/string_encoding_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #field ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute field.

    +
    + +
  • + + +
  • + + + #path ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute path.

    +
    + +
  • + + +
  • + + + #string ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute string.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(str, context:) ⇒ StringEncodingError + + + + + +

+
+

Returns a new instance of StringEncodingError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/string_encoding_error.rb', line 5
+
+def initialize(str, context:)
+  @string = str
+  @field = context[:current_field]
+  @path = context[:current_path]
+  message = "String #{str.inspect} was encoded as #{str.encoding}".dup
+  if @path
+    message << " @ #{@path.join(".")}"
+  end
+  if @field
+    message << " (#{@field.path})"
+  end
+  message << ". GraphQL requires an encoding compatible with UTF-8."
+  super(message)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #fieldObject (readonly) + + + + + +

+
+

Returns the value of attribute field.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/graphql/string_encoding_error.rb', line 4
+
+def field
+  @field
+end
+
+
+ + + +
+

+ + #pathObject (readonly) + + + + + +

+
+

Returns the value of attribute path.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/graphql/string_encoding_error.rb', line 4
+
+def path
+  @path
+end
+
+
+ + + +
+

+ + #stringObject (readonly) + + + + + +

+
+

Returns the value of attribute string.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+4
+5
+6
+
+
# File 'lib/graphql/string_encoding_error.rb', line 4
+
+def string
+  @string
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Subscriptions.html b/api-doc/2.1.6/GraphQL/Subscriptions.html new file mode 100644 index 0000000000..60936a7114 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Subscriptions.html @@ -0,0 +1,1833 @@ + + + + + + + Class: GraphQL::Subscriptions + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Subscriptions + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/subscriptions.rb,
+ lib/graphql/subscriptions/event.rb,
lib/graphql/subscriptions/serialize.rb,
lib/graphql/subscriptions/instrumentation.rb,
lib/graphql/subscriptions/broadcast_analyzer.rb,
lib/graphql/subscriptions/action_cable_subscriptions.rb,
lib/graphql/subscriptions/default_subscription_resolve_extension.rb
+
+
+ +
+ +
+

Direct Known Subclasses

+

ActionCableSubscriptions

+
+

Defined Under Namespace

+

+ + + Modules: Serialize + + + + Classes: ActionCableSubscriptions, BroadcastAnalyzer, DefaultSubscriptionResolveExtension, Event, Instrumentation, InvalidTriggerError, SubscriptionScopeMissingError + + +

+ + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(schema:, validate_update: true, broadcast: false, default_broadcastable: false, **rest) ⇒ Subscriptions + + + + + +

+
+

Returns a new instance of Subscriptions.

+ + +
+
+
+

Parameters:

+
    + +
  • + + schema + + + (Class) + + + + — +

    the GraphQL schema this manager belongs to

    +
    + +
  • + +
  • + + validate_update + + + (Boolean) + + + (defaults to: true) + + + — +

    If false, then validation is skipped when executing updates

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+43
+44
+45
+46
+47
+48
+49
+50
+
+
# File 'lib/graphql/subscriptions.rb', line 43
+
+def initialize(schema:, validate_update: true, broadcast: false, default_broadcastable: false, **rest)
+  if broadcast
+    schema.query_analyzer(Subscriptions::BroadcastAnalyzer)
+  end
+  @default_broadcastable = default_broadcastable
+  @schema = schema
+  @validate_update = validate_update
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #default_broadcastableBoolean (readonly) + + + + + +

+
+

Returns Used when fields don’t have broadcastable: explicitly set.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    Used when fields don’t have broadcastable: explicitly set

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+53
+54
+55
+
+
# File 'lib/graphql/subscriptions.rb', line 53
+
+def default_broadcastable
+  @default_broadcastable
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .use(defn, options = {}) ⇒ Object + + + + + +

+
+ + + +
+
+
+ + +

See Also:

+
    + +
  • for options, concrete implementations may add options.
  • + +
+ +
+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
+
# File 'lib/graphql/subscriptions.rb', line 26
+
+def self.use(defn, options = {})
+  schema = defn.is_a?(Class) ? defn : defn.target
+
+  if schema.subscriptions(inherited: false)
+    raise ArgumentError, "Can't reinstall subscriptions. #{schema} is using #{schema.subscriptions}, can't also add #{self}"
+  end
+
+  instrumentation = Subscriptions::Instrumentation.new(schema: schema)
+  defn.instrument(:query, instrumentation)
+  options[:schema] = schema
+  schema.subscriptions = self.new(**options)
+  schema.add_subscription_extension_if_necessary
+  nil
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #broadcastable?(query_str, **query_options) ⇒ Boolean + + + + + +

+
+

Returns if true, then a query like this one would be broadcasted.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    if true, then a query like this one would be broadcasted

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+236
+237
+238
+239
+240
+241
+242
+243
+
+
# File 'lib/graphql/subscriptions.rb', line 236
+
+def broadcastable?(query_str, **query_options)
+  query = GraphQL::Query.new(@schema, query_str, **query_options)
+  if !query.valid?
+    raise "Invalid query: #{query.validation_errors.map(&:to_h).inspect}"
+  end
+  GraphQL::Analysis::AST.analyze_query(query, @schema.query_analyzers)
+  query.context.namespace(:subscriptions)[:subscription_broadcastable]
+end
+
+
+ +
+

+ + #build_idString + + + + + +

+
+

Returns A new unique identifier for a subscription.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    A new unique identifier for a subscription

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+219
+220
+221
+
+
# File 'lib/graphql/subscriptions.rb', line 219
+
+def build_id
+  SecureRandom.uuid
+end
+
+
+ +
+

+ + #delete_subscription(subscription_id) ⇒ Object + + + + + +

+
+

A subscription was terminated server-side. +Clean up the database.

+ + +
+
+
+

Parameters:

+
    + +
  • + + subscription_id + + + (String) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + + + + + +

    void.

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+214
+215
+216
+
+
# File 'lib/graphql/subscriptions.rb', line 214
+
+def delete_subscription(subscription_id)
+  raise GraphQL::RequiredImplementationMissingError
+end
+
+
+ +
+

+ + #deliver(subscription_id, result) ⇒ void + + + + + +

+
+

This method returns an undefined value.

A subscription query was re-evaluated, returning result. +The result should be send to subscription_id.

+ + +
+
+
+

Parameters:

+
    + +
  • + + subscription_id + + + (String) + + + +
  • + +
  • + + result + + + (Hash) + + + +
  • + +
+ +

Raises:

+ + +
+ + + + +
+
+
+
+197
+198
+199
+
+
# File 'lib/graphql/subscriptions.rb', line 197
+
+def deliver(subscription_id, result)
+  raise GraphQL::RequiredImplementationMissingError
+end
+
+
+ +
+

+ + #execute(subscription_id, event, object) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Run the update query for this subscription and deliver it

+ + +
+
+
+ + +

See Also:

+
    + +
  • GraphQL::Subscriptions.{{#execute_update}
  • + +
  • GraphQL::Subscriptions.{{#deliver}
  • + +
+ +
+ + + + +
+
+
+
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+
+
# File 'lib/graphql/subscriptions.rb', line 161
+
+def execute(subscription_id, event, object)
+  res = execute_update(subscription_id, event, object)
+  if !res.nil?
+    deliver(subscription_id, res)
+
+    if res.context.namespace(:subscriptions)[:unsubscribed]
+      # `unsubscribe` was called, clean up on our side
+      # The transport should also send `{more: false}` to client
+      delete_subscription(subscription_id)
+    end
+  end
+
+end
+
+
+ +
+

+ + #execute_all(event, object) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Event event occurred on object, +Update all subscribers.

+ + +
+
+
+

Parameters:

+ + +

Raises:

+ + +
+ + + + +
+
+
+
+180
+181
+182
+
+
# File 'lib/graphql/subscriptions.rb', line 180
+
+def execute_all(event, object)
+  raise GraphQL::RequiredImplementationMissingError
+end
+
+
+ +
+

+ + #execute_update(subscription_id, event, object) ⇒ GraphQL::Query::Result + + + + + +

+
+

event was triggered on object, and subscription_id was subscribed, +so it should be updated.

+ +

Load subscription_id’s GraphQL data, re-evaluate the query and return the result.

+ + +
+
+
+

Parameters:

+
    + +
  • + + subscription_id + + + (String) + + + +
  • + +
  • + + event + + + (GraphQL::Subscriptions::Event) + + + + — +

    The event which was triggered

    +
    + +
  • + +
  • + + object + + + (Object) + + + + — +

    The value for the subscription field

    +
    + +
  • + +
+ +

Returns:

+ + +
+ + + + +
+
+
+
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+
+
# File 'lib/graphql/subscriptions.rb', line 107
+
+def execute_update(subscription_id, event, object)
+  # Lookup the saved data for this subscription
+  query_data = read_subscription(subscription_id)
+  if query_data.nil?
+    delete_subscription(subscription_id)
+    return nil
+  end
+
+  # Fetch the required keys from the saved data
+  query_string = query_data.fetch(:query_string)
+  variables = query_data.fetch(:variables)
+  context = query_data.fetch(:context)
+  operation_name = query_data.fetch(:operation_name)
+  execute_options = {
+    query: query_string,
+    context: context,
+    subscription_topic: event.topic,
+    operation_name: operation_name,
+    variables: variables,
+    root_value: object,
+  }
+
+   # merge event's and query's context together
+  context.merge!(event.context) unless event.context.nil? || context.nil?
+
+  execute_options[:validate] = validate_update?(**execute_options)
+  result = @schema.execute(**execute_options)
+  subscriptions_context = result.context.namespace(:subscriptions)
+  if subscriptions_context[:no_update]
+    result = nil
+  end
+
+  if subscriptions_context[:unsubscribed] && !subscriptions_context[:final_update]
+    # `unsubscribe` was called, clean up on our side
+    # The transport should also send `{more: false}` to client
+    delete_subscription(subscription_id)
+    result = nil
+  end
+
+  result
+end
+
+
+ +
+

+ + #normalize_name(event_or_arg_name) ⇒ String + + + + + +

+
+

Convert a user-provided event name or argument +to the equivalent in GraphQL.

+ +

By default, it converts the identifier to camelcase. +Override this in a subclass to change the transformation.

+ + +
+
+
+

Parameters:

+
    + +
  • + + event_or_arg_name + + + (String, Symbol) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+231
+232
+233
+
+
# File 'lib/graphql/subscriptions.rb', line 231
+
+def normalize_name(event_or_arg_name)
+  Schema::Member::BuildType.camelize(event_or_arg_name.to_s)
+end
+
+
+ +
+

+ + #read_subscription(subscription_id) ⇒ Hash + + + + + +

+
+

The system wants to send an update to this subscription. +Read its data and return it.

+ + +
+
+
+

Parameters:

+
    + +
  • + + subscription_id + + + (String) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Hash) + + + + — +

    Containing required keys

    +
    + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+188
+189
+190
+
+
# File 'lib/graphql/subscriptions.rb', line 188
+
+def read_subscription(subscription_id)
+  raise GraphQL::RequiredImplementationMissingError
+end
+
+
+ +
+

+ + #trigger(event_name, args, object, scope: nil, context: {}) ⇒ void + + + + + +

+
+

This method returns an undefined value.

Fetch subscriptions matching this field + arguments pair +And pass them off to the queue.

+ + +
+
+
+

Parameters:

+
    + +
  • + + event_name + + + (String) + + + +
  • + +
  • + + args + + + (Hash<String, Symbol => Object]) + + + + — +

    rgs [Hash<String, Symbol => Object]

    +
    + +
  • + +
  • + + object + + + (Object) + + + +
  • + +
  • + + scope + + + (Symbol, String) + + + (defaults to: nil) + + +
  • + +
  • + + context + + + (Hash) + + + (defaults to: {}) + + +
  • + +
+ + +
+ + + + +
+
+
+
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+
+
# File 'lib/graphql/subscriptions.rb', line 63
+
+def trigger(event_name, args, object, scope: nil, context: {})
+  # Make something as context-like as possible, even though there isn't a current query:
+  dummy_query = GraphQL::Query.new(@schema, "{ __typename }", validate: false, context: context)
+  context = dummy_query.context
+  event_name = event_name.to_s
+
+  # Try with the verbatim input first:
+  field = @schema.get_field(@schema.subscription, event_name, context)
+
+  if field.nil?
+    # And if it wasn't found, normalize it:
+    normalized_event_name = normalize_name(event_name)
+    field = @schema.get_field(@schema.subscription, normalized_event_name, context)
+    if field.nil?
+      raise InvalidTriggerError, "No subscription matching trigger: #{event_name} (looked for #{@schema.subscription.graphql_name}.#{normalized_event_name})"
+    end
+  else
+    # Since we found a field, the original input was already normalized
+    normalized_event_name = event_name
+  end
+
+  # Normalize symbol-keyed args to strings, try camelizing them
+  # Should this accept a real context somehow?
+  normalized_args = normalize_arguments(normalized_event_name, field, args, GraphQL::Query::NullContext.instance)
+
+  event = Subscriptions::Event.new(
+    name: normalized_event_name,
+    arguments: normalized_args,
+    field: field,
+    scope: scope,
+    context: context,
+  )
+  execute_all(event, object)
+end
+
+
+ +
+

+ + #validate_update?(query:, context:, root_value:, subscription_topic:, operation_name:, variables:) ⇒ Boolean + + + + + +

+
+

Define this method to customize whether to validate +this subscription when executing an update.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + + — +

    defaults to true, or false if validate: false is provided.

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+153
+154
+155
+
+
# File 'lib/graphql/subscriptions.rb', line 153
+
+def validate_update?(query:, context:, root_value:, subscription_topic:, operation_name:, variables:)
+  @validate_update
+end
+
+
+ +
+

+ + #write_subscription(query, events) ⇒ void + + + + + +

+
+

This method returns an undefined value.

query was executed and found subscriptions to events. +Update the database to reflect this new state.

+ + +
+
+
+

Parameters:

+ + +

Raises:

+ + +
+ + + + +
+
+
+
+206
+207
+208
+
+
# File 'lib/graphql/subscriptions.rb', line 206
+
+def write_subscription(query, events)
+  raise GraphQL::RequiredImplementationMissingError
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Subscriptions/ActionCableSubscriptions.html b/api-doc/2.1.6/GraphQL/Subscriptions/ActionCableSubscriptions.html new file mode 100644 index 0000000000..28ec0cd998 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Subscriptions/ActionCableSubscriptions.html @@ -0,0 +1,1067 @@ + + + + + + + Class: GraphQL::Subscriptions::ActionCableSubscriptions + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Subscriptions::ActionCableSubscriptions + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Subscriptions + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/subscriptions/action_cable_subscriptions.rb
+
+ +
+ +

Overview

+
+

A subscriptions implementation that sends data +as ActionCable broadcastings.

+ +

Some things to keep in mind:

+ +
    +
  • No queueing system; ActiveJob should be added
  • +
  • Take care to reload context when re-delivering the subscription. (see Query#subscription_update?)
  • +
  • Avoid the async ActionCable adapter and use the redis or PostgreSQL adapters instead. Otherwise calling #trigger won’t work from background jobs or the Rails console.
  • +
+ + +
+
+
+ +
+

Examples:

+ + +

Adding ActionCableSubscriptions to your schema

+

+ +
class MySchema < GraphQL::Schema
+  # ...
+  use GraphQL::Subscriptions::ActionCableSubscriptions
+end
+ + +

Implementing a channel for GraphQL Subscriptions

+

+ +
class GraphqlChannel < ApplicationCable::Channel
+  def subscribed
+    @subscription_ids = []
+  end
+
+  def execute(data)
+    query = data["query"]
+    variables = ensure_hash(data["variables"])
+    operation_name = data["operationName"]
+    context = {
+      # Re-implement whatever context methods you need
+      # in this channel or ApplicationCable::Channel
+      # current_user: current_user,
+      # Make sure the channel is in the context
+      channel: self,
+    }
+
+    result = MySchema.execute(
+      query,
+      context: context,
+      variables: variables,
+      operation_name: operation_name
+    )
+
+    payload = {
+      result: result.to_h,
+      more: result.subscription?,
+    }
+
+    # Track the subscription here so we can remove it
+    # on unsubscribe.
+    if result.context[:subscription_id]
+      @subscription_ids << result.context[:subscription_id]
+    end
+
+    transmit(payload)
+  end
+
+  def unsubscribed
+    @subscription_ids.each { |sid|
+      MySchema.subscriptions.delete_subscription(sid)
+    }
+  end
+
+  private
+
+    def ensure_hash(ambiguous_param)
+      case ambiguous_param
+      when String
+        if ambiguous_param.present?
+          ensure_hash(JSON.parse(ambiguous_param))
+        else
+          {}
+        end
+      when Hash, ActionController::Parameters
+        ambiguous_param
+      when nil
+        {}
+      else
+        raise ArgumentError, "Unexpected parameter: #{ambiguous_param}"
+      end
+    end
+end
+ +
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
SUBSCRIPTION_PREFIX = + +
+
"graphql-subscription:"
+ +
EVENT_PREFIX = + +
+
"graphql-event:"
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Subscriptions

+

#default_broadcastable

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Subscriptions

+

#broadcastable?, #build_id, #execute, #execute_update, #normalize_name, #trigger, use, #validate_update?

+
+

Constructor Details

+ +
+

+ + #initialize(serializer: Serialize, namespace: '', action_cable: ActionCable, action_cable_coder: ActiveSupport::JSON, **rest) ⇒ ActionCableSubscriptions + + + + + +

+
+

Returns a new instance of ActionCableSubscriptions.

+ + +
+
+
+

Parameters:

+
    + +
  • + + serializer + + + (<#dump(obj), #load(string)] Used for serializing messages before handing them to `.broadcast(msg)`) + + + (defaults to: Serialize) + + + — +

    erializer [<#dump(obj), #load(string)] Used for serializing messages before handing them to .broadcast(msg)

    +
    + +
  • + +
  • + + namespace + + + (string) + + + (defaults to: '') + + + — +

    Used to namespace events and subscriptions (default: ‘’)

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+
+
# File 'lib/graphql/subscriptions/action_cable_subscriptions.rb', line 90
+
+def initialize(serializer: Serialize, namespace: '', action_cable: ActionCable, action_cable_coder: ActiveSupport::JSON, **rest)
+  # A per-process map of subscriptions to deliver.
+  # This is provided by Rails, so let's use it
+  @subscriptions = Concurrent::Map.new
+  @events = Concurrent::Map.new do |h, k|
+    h.compute_if_absent(k) do
+      Concurrent::Map.new do |h2, k2|
+        h2.compute_if_absent(k2) { Concurrent::Array.new }
+      end
+    end
+  end
+  @action_cable = action_cable
+  @action_cable_coder = action_cable_coder
+  @serializer = serializer
+  @serialize_with_context = case @serializer.method(:load).arity
+  when 1
+    false
+  when 2
+    true
+  else
+    raise ArgumentError, "#{@serializer} must repond to `.load` accepting one or two arguments"
+  end
+  @transmit_ns = namespace
+  super
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #delete_subscription(subscription_id) ⇒ Object + + + + + +

+
+

The channel was closed, forget about it.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+
+
# File 'lib/graphql/subscriptions/action_cable_subscriptions.rb', line 224
+
+def delete_subscription(subscription_id)
+  query = @subscriptions.delete(subscription_id)
+  # In case this came from the server, tell the client to unsubscribe:
+  @action_cable.server.broadcast(stream_subscription_name(subscription_id), { more: false })
+  # This can be `nil` when `.trigger` happens inside an unsubscribed ActionCable channel,
+  # see https://github.com/rmosolgo/graphql-ruby/issues/2478
+  if query
+    events = query.context.namespace(:subscriptions)[:events]
+    events.each do |event|
+      ev_by_fingerprint = @events[event.topic]
+      ev_for_fingerprint = ev_by_fingerprint[event.fingerprint]
+      ev_for_fingerprint.delete(event)
+      if ev_for_fingerprint.empty?
+        ev_by_fingerprint.delete(event.fingerprint)
+      end
+    end
+  end
+end
+
+
+ +
+

+ + #deliver(subscription_id, result) ⇒ Object + + + + + +

+
+

This subscription was re-evaluated. +Send it to the specific stream where this client was waiting.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+126
+127
+128
+129
+130
+
+
# File 'lib/graphql/subscriptions/action_cable_subscriptions.rb', line 126
+
+def deliver(subscription_id, result)
+  has_more = !result.context.namespace(:subscriptions)[:final_update]
+  payload = { result: result.to_h, more: has_more }
+  @action_cable.server.broadcast(stream_subscription_name(subscription_id), payload)
+end
+
+
+ +
+

+ + #execute_all(event, object) ⇒ Object + + + + + +

+
+

An event was triggered; Push the data over ActionCable. +Subscribers will re-evaluate locally.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+118
+119
+120
+121
+122
+
+
# File 'lib/graphql/subscriptions/action_cable_subscriptions.rb', line 118
+
+def execute_all(event, object)
+  stream = stream_event_name(event)
+  message = @serializer.dump(object)
+  @action_cable.server.broadcast(stream, message)
+end
+
+
+ +
+

+ + #load_action_cable_message(message, context) ⇒ Object + + + + + +

+
+

This is called to turn an ActionCable-broadcasted string (JSON) +into a query-ready application object.

+ + +
+
+
+

Parameters:

+
    + +
  • + + message + + + (String) + + + + — +

    n ActionCable-broadcasted string (JSON)

    +
    + +
  • + +
  • + + context + + + (GraphQL::Query::Context) + + + + — +

    the context of the first event for a given subscription fingerprint

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+197
+198
+199
+200
+201
+202
+203
+
+
# File 'lib/graphql/subscriptions/action_cable_subscriptions.rb', line 197
+
+def load_action_cable_message(message, context)
+  if @serialize_with_context
+    @serializer.load(message, context)
+  else
+    @serializer.load(message)
+  end
+end
+
+
+ +
+

+ + #read_subscription(subscription_id) ⇒ Object + + + + + +

+
+

Return the query from “storage” (in memory)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+
+
# File 'lib/graphql/subscriptions/action_cable_subscriptions.rb', line 206
+
+def read_subscription(subscription_id)
+  query = @subscriptions[subscription_id]
+  if query.nil?
+    # This can happen when a subscription is triggered from an unsubscribed channel,
+    # see https://github.com/rmosolgo/graphql-ruby/issues/2478.
+    # (This `nil` is handled by `#execute_update`)
+    nil
+  else
+    {
+      query_string: query.query_string,
+      variables: query.provided_variables,
+      context: query.context.to_h,
+      operation_name: query.operation_name,
+    }
+  end
+end
+
+
+ +
+

+ + #setup_stream(channel, initial_event) ⇒ Object + + + + + +

+
+

Every subscribing channel is listening here, but only one of them takes any action. +This is so we can reuse payloads when possible, and make one payload to send to +all subscribers.

+ +

But the problem is, any channel could close at any time, so each channel has to +be ready to take over the primary position.

+ +

To make sure there’s always one-and-only-one channel building payloads, +let the listener belonging to the first event on the list be +the one to build and publish payloads.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
+
# File 'lib/graphql/subscriptions/action_cable_subscriptions.rb', line 167
+
+def setup_stream(channel, initial_event)
+  topic = initial_event.topic
+  channel.stream_from(stream_event_name(initial_event), coder: @action_cable_coder) do |message|
+    events_by_fingerprint = @events[topic]
+    object = nil
+    events_by_fingerprint.each do |_fingerprint, events|
+      if events.any? && events.first == initial_event
+        # The fingerprint has told us that this response should be shared by all subscribers,
+        # so just run it once, then deliver the result to every subscriber
+        first_event = events.first
+        first_subscription_id = first_event.context.fetch(:subscription_id)
+        object ||= load_action_cable_message(message, first_event.context)
+        result = execute_update(first_subscription_id, first_event, object)
+        if !result.nil?
+          # Having calculated the result _once_, send the same payload to all subscribers
+          events.each do |event|
+            subscription_id = event.context.fetch(:subscription_id)
+            deliver(subscription_id, result)
+          end
+        end
+      end
+    end
+    nil
+  end
+end
+
+
+ +
+

+ + #write_subscription(query, events) ⇒ Object + + + + + +

+
+

A query was run where these events were subscribed to. +Store them in memory in this ActionCable frontend. +It will receive notifications when events come in +and re-evaluate the query locally.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+
+
# File 'lib/graphql/subscriptions/action_cable_subscriptions.rb', line 136
+
+def write_subscription(query, events)
+  unless (channel = query.context[:channel])
+    raise GraphQL::Error, "This GraphQL Subscription client does not support the transport protocol expected"\
+      "by the backend Subscription Server implementation (graphql-ruby ActionCableSubscriptions in this case)."\
+      "Some official client implementation including Apollo (https://graphql-ruby.org/javascript_client/apollo_subscriptions.html), "\
+      "Relay Modern (https://graphql-ruby.org/javascript_client/relay_subscriptions.html#actioncable)."\
+      "GraphiQL via `graphiql-rails` may not work out of box (#1051)."
+  end
+  subscription_id = query.context[:subscription_id] ||= build_id
+  stream = stream_subscription_name(subscription_id)
+  channel.stream_from(stream)
+  @subscriptions[subscription_id] = query
+  events.each do |event|
+    # Setup a new listener to run all events with this topic in this process
+    setup_stream(channel, event)
+    # Add this event to the list of events to be updated
+    @events[event.topic][event.fingerprint] << event
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Subscriptions/BroadcastAnalyzer.html b/api-doc/2.1.6/GraphQL/Subscriptions/BroadcastAnalyzer.html new file mode 100644 index 0000000000..7e8b9dc1b4 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Subscriptions/BroadcastAnalyzer.html @@ -0,0 +1,508 @@ + + + + + + + Class: GraphQL::Subscriptions::BroadcastAnalyzer + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Subscriptions::BroadcastAnalyzer + + + Private +

+
+ +
+
Inherits:
+
+ Analysis::AST::Analyzer + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/subscriptions/broadcast_analyzer.rb
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

Detect whether the current operation: +- Is a subscription operation +- Is completely broadcastable

+ +

Assign the result to context.namespace(:subscriptions)[:subscription_broadcastable]

+ + +
+
+
+ + +

See Also:

+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Analysis::AST::Analyzer

+

#visit?

+
+

Constructor Details

+ +
+

+ + #initialize(subject) ⇒ BroadcastAnalyzer + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of BroadcastAnalyzer.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/subscriptions/broadcast_analyzer.rb', line 13
+
+def initialize(subject)
+  super
+  @default_broadcastable = subject.schema.subscriptions.default_broadcastable
+  # Maybe this will get set to false while analyzing
+  @subscription_broadcastable = true
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #analyze?Boolean + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Only analyze subscription operations

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'lib/graphql/subscriptions/broadcast_analyzer.rb', line 21
+
+def analyze?
+  @query.subscription?
+end
+
+
+ +
+

+ + #on_enter_field(node, parent, visitor) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/graphql/subscriptions/broadcast_analyzer.rb', line 25
+
+def on_enter_field(node, parent, visitor)
+  if (@subscription_broadcastable == false) || visitor.skipping?
+    return
+  end
+
+  current_field = visitor.field_definition
+  apply_broadcastable(current_field)
+
+  current_type = visitor.parent_type_definition
+  if current_type.kind.interface?
+    pt = @query.possible_types(current_type)
+    pt.each do |object_type|
+      ot_field = @query.get_field(object_type, current_field.graphql_name)
+      # Inherited fields would be exactly the same object;
+      # only check fields that are overrides of the inherited one
+      if ot_field && ot_field != current_field
+        apply_broadcastable(ot_field)
+      end
+    end
+  end
+end
+
+
+ +
+

+ + #resultvoid + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This method returns an undefined value.

Assign the result to context. +(This method is allowed to return an error, but we don’t need to)

+ + +
+
+
+ + +
+ + + + +
+
+
+
+50
+51
+52
+53
+
+
# File 'lib/graphql/subscriptions/broadcast_analyzer.rb', line 50
+
+def result
+  query.context.namespace(:subscriptions)[:subscription_broadcastable] = @subscription_broadcastable
+  nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Subscriptions/DefaultSubscriptionResolveExtension.html b/api-doc/2.1.6/GraphQL/Subscriptions/DefaultSubscriptionResolveExtension.html new file mode 100644 index 0000000000..4117fc1b0e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Subscriptions/DefaultSubscriptionResolveExtension.html @@ -0,0 +1,340 @@ + + + + + + + Class: GraphQL::Subscriptions::DefaultSubscriptionResolveExtension + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Subscriptions::DefaultSubscriptionResolveExtension + + + +

+
+ +
+
Inherits:
+
+ GraphQL::Schema::FieldExtension + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/subscriptions/default_subscription_resolve_extension.rb
+
+ +
+ + + + + + + +

Instance Attribute Summary

+ +

Attributes inherited from GraphQL::Schema::FieldExtension

+

#added_default_arguments, #added_extras, #field, #options

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from GraphQL::Schema::FieldExtension

+

#after_define, #after_define_apply, #apply, default_argument, default_argument_configurations, extras, #initialize

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::FieldExtension

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #after_resolve(value:, context:, object:, arguments:, **rest) ⇒ Object + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+
+
# File 'lib/graphql/subscriptions/default_subscription_resolve_extension.rb', line 20
+
+def after_resolve(value:, context:, object:, arguments:, **rest)
+  if value.is_a?(GraphQL::ExecutionError)
+    value
+  elsif (events = context.namespace(:subscriptions)[:events])
+    # This is the first execution, so gather an Event
+    # for the backend to register:
+    event = Subscriptions::Event.new(
+      name: field.name,
+      arguments: arguments_without_field_extras(arguments: arguments),
+      context: context,
+      field: field,
+    )
+    events << event
+    value
+  elsif context.query.subscription_topic == Subscriptions::Event.serialize(
+      field.name,
+      arguments_without_field_extras(arguments: arguments),
+      field,
+      scope: (field.subscription_scope ? context[field.subscription_scope] : nil),
+    )
+    # This is a subscription update. The resolver returned `skip` if it should be skipped,
+    # or else it returned an object to resolve the update.
+    value
+  else
+    # This is a subscription update, but this event wasn't triggered.
+    context.skip
+  end
+end
+
+
+ +
+

+ + #resolve(context:, object:, arguments:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/subscriptions/default_subscription_resolve_extension.rb', line 5
+
+def resolve(context:, object:, arguments:)
+  has_override_implementation = @field.resolver ||
+    object.respond_to?(@field.resolver_method)
+
+  if !has_override_implementation
+    if context.query.subscription_update?
+      object.object
+    else
+      context.skip
+    end
+  else
+    yield(object, arguments)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Subscriptions/Event.html b/api-doc/2.1.6/GraphQL/Subscriptions/Event.html new file mode 100644 index 0000000000..2536951628 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Subscriptions/Event.html @@ -0,0 +1,798 @@ + + + + + + + Class: GraphQL::Subscriptions::Event + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Subscriptions::Event + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/subscriptions/event.rb
+
+ +
+ +

Overview

+
+

This thing can be: +- Subscribed to by subscription { ... } +- Triggered by MySchema.subscriber.trigger(name, arguments, obj)

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(name:, arguments:, field: nil, context: nil, scope: nil) ⇒ Event + + + + + +

+
+

Returns a new instance of Event.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
+
# File 'lib/graphql/subscriptions/event.rb', line 21
+
+def initialize(name:, arguments:, field: nil, context: nil, scope: nil)
+  @name = name
+  @arguments = arguments
+  @context = context
+  field ||= context.field
+  scope_key = field.subscription_scope
+  scope_val = scope || (context && scope_key && context[scope_key])
+  if scope_key &&
+      (subscription = field.resolver) &&
+      (subscription.respond_to?(:subscription_scope_optional?)) &&
+      !subscription.subscription_scope_optional? &&
+      scope_val.nil?
+    raise Subscriptions::SubscriptionScopeMissingError, "#{field.path} (#{subscription}) requires a `scope:` value to trigger updates (Set `subscription_scope ..., optional: true` to disable this requirement)"
+  end
+
+  @topic = self.class.serialize(name, arguments, field, scope: scope_val, context: context)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #argumentsGraphQL::Execution::Interpreter::Arguments (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'lib/graphql/subscriptions/event.rb', line 13
+
+def arguments
+  @arguments
+end
+
+
+ + + +
+

+ + #contextGraphQL::Query::Context (readonly) + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/subscriptions/event.rb', line 16
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #nameString (readonly) + + + + + +

+
+

Returns Corresponds to the Subscription root field name.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    Corresponds to the Subscription root field name

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'lib/graphql/subscriptions/event.rb', line 10
+
+def name
+  @name
+end
+
+
+ + + +
+

+ + #topicString (readonly) + + + + + +

+
+

Returns An opaque string which identifies this event, derived from name and arguments.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    An opaque string which identifies this event, derived from name and arguments

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/subscriptions/event.rb', line 19
+
+def topic
+  @topic
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .serialize(_name, arguments, field, scope:, context: GraphQL::Query::NullContext.instance) ⇒ String + + + + + +

+
+

Returns an identifier for this unit of subscription.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    an identifier for this unit of subscription

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+40
+41
+42
+43
+44
+
+
# File 'lib/graphql/subscriptions/event.rb', line 40
+
+def self.serialize(_name, arguments, field, scope:, context: GraphQL::Query::NullContext.instance)
+  subscription = field.resolver || GraphQL::Schema::Subscription
+  normalized_args = stringify_args(field, arguments.to_h, context)
+  subscription.topic_for(arguments: normalized_args, field: field, scope: scope)
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #fingerprintString + + + + + +

+
+

Returns a logical identifier for this event. (Stable when the query is broadcastable.).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    a logical identifier for this event. (Stable when the query is broadcastable.)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
+
# File 'lib/graphql/subscriptions/event.rb', line 47
+
+def fingerprint
+  @fingerprint ||= begin
+    # When this query has been flagged as broadcastable,
+    # use a generalized, stable fingerprint so that
+    # duplicate subscriptions can be evaluated and distributed in bulk.
+    # (`@topic` includes field, args, and subscription scope already.)
+    if @context.namespace(:subscriptions)[:subscription_broadcastable]
+      "#{@topic}/#{@context.query.fingerprint}"
+    else
+      # not broadcastable, build a unique ID for this event
+      @context.schema.subscriptions.build_id
+    end
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Subscriptions/Instrumentation.html b/api-doc/2.1.6/GraphQL/Subscriptions/Instrumentation.html new file mode 100644 index 0000000000..205c71f89f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Subscriptions/Instrumentation.html @@ -0,0 +1,355 @@ + + + + + + + Class: GraphQL::Subscriptions::Instrumentation + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Subscriptions::Instrumentation + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/subscriptions/instrumentation.rb
+
+ +
+ +

Overview

+
+

Wrap the root fields of the subscription type with special logic for: +- Registering the subscription during the first execution +- Evaluating the triggered portion(s) of the subscription during later execution

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(schema:) ⇒ Instrumentation + + + + + +

+
+

Returns a new instance of Instrumentation.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/subscriptions/instrumentation.rb', line 8
+
+def initialize(schema:)
+  @schema = schema
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #after_query(query) ⇒ Object + + + + + +

+
+

After checking the root fields, pass the gathered events to the store

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+23
+24
+25
+
+
# File 'lib/graphql/subscriptions/instrumentation.rb', line 20
+
+def after_query(query)
+  events = query.context.namespace(:subscriptions)[:events]
+  if events && events.any?
+    @schema.subscriptions.write_subscription(query, events)
+  end
+end
+
+
+ +
+

+ + #before_query(query) ⇒ Object + + + + + +

+
+

If needed, prepare to gather events which this query subscribes to

+ + +
+
+
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/subscriptions/instrumentation.rb', line 13
+
+def before_query(query)
+  if query.subscription? && !query.subscription_update?
+    query.context.namespace(:subscriptions)[:events] = []
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Subscriptions/InvalidTriggerError.html b/api-doc/2.1.6/GraphQL/Subscriptions/InvalidTriggerError.html new file mode 100644 index 0000000000..56c2b8d4a1 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Subscriptions/InvalidTriggerError.html @@ -0,0 +1,144 @@ + + + + + + + Exception: GraphQL::Subscriptions::InvalidTriggerError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Subscriptions::InvalidTriggerError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/subscriptions.rb
+
+ +
+ +

Overview

+
+

Raised when either: +- the triggered event_name doesn’t match a field in the schema; or +- one or more arguments don’t match the field arguments

+ + +
+
+
+ + +
+ + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Subscriptions/Serialize.html b/api-doc/2.1.6/GraphQL/Subscriptions/Serialize.html new file mode 100644 index 0000000000..c09403b7bb --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Subscriptions/Serialize.html @@ -0,0 +1,591 @@ + + + + + + + Module: GraphQL::Subscriptions::Serialize + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Subscriptions::Serialize + + + Private +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/subscriptions/serialize.rb
+
+ +
+ +

Overview

+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+

Serialization helpers for passing subscription data around.

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
GLOBALID_KEY = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"__gid__"
+ +
SYMBOL_KEY = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"__sym__"
+ +
SYMBOL_KEYS_KEY = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"__sym_keys__"
+ +
TIMESTAMP_KEY = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"__timestamp__"
+ +
TIMESTAMP_FORMAT = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+

eg ‘2020-01-01 23:59:59.123456789+05:00’

+ + +
+
+
+ + +
+
+
"%Y-%m-%d %H:%M:%S.%N%z"
+ +
OPEN_STRUCT_KEY = +
+
+

+ This constant is part of a private API. + You should avoid using this constant if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+
+
"__ostruct__"
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .dump(obj) ⇒ String + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns The stringified object.

+ + +
+
+
+

Parameters:

+
    + +
  • + + obj + + + (Object) + + + + — +

    Some subscription-related data to dump

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + + — +

    The stringified object

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/subscriptions/serialize.rb', line 26
+
+def dump(obj)
+  JSON.generate(dump_value(obj), quirks_mode: true)
+end
+
+
+ +
+

+ + .dump_recursive(obj) ⇒ String + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

This is for turning objects into subscription scopes. +It’s a one-way transformation, can’t reload this :’(

+ + +
+
+
+

Parameters:

+
    + +
  • + + obj + + + (Object) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
+
# File 'lib/graphql/subscriptions/serialize.rb', line 34
+
+def dump_recursive(obj)
+  case
+  when obj.is_a?(Array)
+    obj.map { |i| dump_recursive(i) }.join(':')
+  when obj.is_a?(Hash)
+    obj.map { |k, v| "#{dump_recursive(k)}:#{dump_recursive(v)}" }.join(":")
+  when obj.is_a?(GraphQL::Schema::InputObject)
+    dump_recursive(obj.to_h)
+  when obj.respond_to?(:to_gid_param)
+    obj.to_gid_param
+  when obj.respond_to?(:to_param)
+    obj.to_param
+  else
+    obj.to_s
+  end
+end
+
+
+ +
+

+ + .load(str) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns An object equivalent to the one passed to dump.

+ + +
+
+
+

Parameters:

+
    + +
  • + + str + + + (String) + + + + — +

    A serialized object from dump

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    An object equivalent to the one passed to dump

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+19
+20
+21
+22
+
+
# File 'lib/graphql/subscriptions/serialize.rb', line 19
+
+def load(str)
+  parsed_obj = JSON.parse(str)
+  load_value(parsed_obj)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Subscriptions/SubscriptionScopeMissingError.html b/api-doc/2.1.6/GraphQL/Subscriptions/SubscriptionScopeMissingError.html new file mode 100644 index 0000000000..3538c98f15 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Subscriptions/SubscriptionScopeMissingError.html @@ -0,0 +1,145 @@ + + + + + + + Exception: GraphQL::Subscriptions::SubscriptionScopeMissingError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::Subscriptions::SubscriptionScopeMissingError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/subscriptions.rb
+
+ +
+ +

Overview

+
+

Raised when either: +- An initial subscription didn’t have a value for context[subscription_scope] +- Or, an update didn’t pass .trigger(..., scope:) +When raised, the initial subscription or update fails completely.

+ + +
+
+
+ + +
+ + + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing.html b/api-doc/2.1.6/GraphQL/Tracing.html new file mode 100644 index 0000000000..89103e96e2 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing.html @@ -0,0 +1,135 @@ + + + + + + + Module: GraphQL::Tracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing.rb,
+ lib/graphql/tracing/trace.rb,
lib/graphql/tracing/scout_trace.rb,
lib/graphql/tracing/legacy_trace.rb,
lib/graphql/tracing/statsd_trace.rb,
lib/graphql/tracing/scout_tracing.rb,
lib/graphql/tracing/data_dog_trace.rb,
lib/graphql/tracing/platform_trace.rb,
lib/graphql/tracing/statsd_tracing.rb,
lib/graphql/tracing/appoptics_trace.rb,
lib/graphql/tracing/appsignal_trace.rb,
lib/graphql/tracing/new_relic_trace.rb,
lib/graphql/tracing/data_dog_tracing.rb,
lib/graphql/tracing/platform_tracing.rb,
lib/graphql/tracing/prometheus_trace.rb,
lib/graphql/tracing/appoptics_tracing.rb,
lib/graphql/tracing/appsignal_tracing.rb,
lib/graphql/tracing/new_relic_tracing.rb,
lib/graphql/tracing/prometheus_tracing.rb,
lib/graphql/tracing/notifications_trace.rb,
lib/graphql/tracing/notifications_tracing.rb,
lib/graphql/tracing/active_support_notifications_trace.rb,
lib/graphql/tracing/active_support_notifications_tracing.rb,
lib/graphql/tracing/prometheus_tracing/graphql_collector.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: ActiveSupportNotificationsTrace, ActiveSupportNotificationsTracing, AppOpticsTrace, AppsignalTrace, CallLegacyTracers, DataDogTrace, NewRelicTrace, NotificationsTrace, NullTracer, PlatformTrace, PrometheusTrace, ScoutTrace, StatsdTrace, Traceable + + + + Classes: AppOpticsTracing, AppsignalTracing, DataDogTracing, LegacyTrace, NewRelicTracing, NotificationsTracing, PlatformTracing, PrometheusTracing, ScoutTracing, StatsdTracing, Trace + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
NullTrace = + +
+
Trace.new
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/ActiveSupportNotificationsTrace.html b/api-doc/2.1.6/GraphQL/Tracing/ActiveSupportNotificationsTrace.html new file mode 100644 index 0000000000..2e22446c67 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/ActiveSupportNotificationsTrace.html @@ -0,0 +1,208 @@ + + + + + + + Module: GraphQL::Tracing::ActiveSupportNotificationsTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::ActiveSupportNotificationsTrace + + + +

+
+ + + + + + +
+
Includes:
+
NotificationsTrace
+
+ + + + + + +
+
Defined in:
+
lib/graphql/tracing/active_support_notifications_trace.rb
+
+ +
+ +

Overview

+
+

This implementation forwards events to ActiveSupport::Notifications +with a graphql suffix.

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + + + +

Methods included from PlatformTrace

+

#platform_authorized_lazy, #platform_execute_field_lazy, #platform_resolve_type_lazy

+ + +
+

Instance Method Details

+ + +
+

+ + #initialize(engine: ActiveSupport::Notifications, **rest) ⇒ Object + + + + + +

+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'lib/graphql/tracing/active_support_notifications_trace.rb', line 11
+
+def initialize(engine: ActiveSupport::Notifications, **rest)
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/ActiveSupportNotificationsTracing.html b/api-doc/2.1.6/GraphQL/Tracing/ActiveSupportNotificationsTracing.html new file mode 100644 index 0000000000..1cb105b894 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/ActiveSupportNotificationsTracing.html @@ -0,0 +1,224 @@ + + + + + + + Module: GraphQL::Tracing::ActiveSupportNotificationsTracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::ActiveSupportNotificationsTracing + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/active_support_notifications_tracing.rb
+
+ +
+ +

Overview

+
+

This implementation forwards events to ActiveSupport::Notifications +with a graphql suffix.

+ + +
+
+
+ + +

See Also:

+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
KEYS = +
+
+

A cache of frequently-used keys to avoid needless string allocations

+ + +
+
+
+ + +
+
+
NotificationsTracing::KEYS
+ +
NOTIFICATIONS_ENGINE = + +
+
NotificationsTracing.new(ActiveSupport::Notifications)
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .trace(key, metadata, &blk) ⇒ Object + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/tracing/active_support_notifications_tracing.rb', line 16
+
+def self.trace(key, , &blk)
+  NOTIFICATIONS_ENGINE.trace(key, , &blk)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/AppOpticsTrace.html b/api-doc/2.1.6/GraphQL/Tracing/AppOpticsTrace.html new file mode 100644 index 0000000000..65b50504a0 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/AppOpticsTrace.html @@ -0,0 +1,859 @@ + + + + + + + Module: GraphQL::Tracing::AppOpticsTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::AppOpticsTrace + + + +

+
+ + + + + + +
+
Includes:
+
PlatformTrace
+
+ + + + + + +
+
Defined in:
+
lib/graphql/tracing/appoptics_trace.rb
+
+ +
+ +

Overview

+
+

This class uses the AppopticsAPM SDK from the appoptics_apm gem to create +traces for GraphQL.

+ +

There are 4 configurations available. They can be set in the +appoptics_apm config file or in code. Please see: +https://docs.appoptics.com/kb/apm_tracing/ruby/configure

+ +
AppOpticsAPM::Config[:graphql][:enabled] = true|false
+AppOpticsAPM::Config[:graphql][:transaction_name]  = true|false
+AppOpticsAPM::Config[:graphql][:sanitize_query] = true|false
+AppOpticsAPM::Config[:graphql][:remove_comments] = true|false
+
+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
PREP_KEYS = +
+
+

These GraphQL events will show up as ‘graphql.prep’ spans

+ + +
+
+
+ + +
+
+
['lex', 'parse', 'validate', 'analyze_query', 'analyze_multiplex'].freeze
+ +
EXEC_KEYS = +
+
+

These GraphQL events will show up as ‘graphql.execute’ spans

+ + +
+
+
+ + +
+
+
['execute_multiplex', 'execute_query', 'execute_query_lazy'].freeze
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ +
    + +
  • + + + .version ⇒ Object + + + + + + + + + + + + + +

    During auto-instrumentation this version of AppOpticsTracing is compared with the version provided in the appoptics_apm gem, so that the newer version of the class can be used.

    +
    + +
  • + + +
+ +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from PlatformTrace

+

#initialize, #platform_authorized_lazy, #platform_execute_field_lazy, #platform_resolve_type_lazy

+ + +
+

Class Method Details

+ + +
+

+ + .versionObject + + + + + +

+
+

During auto-instrumentation this version of AppOpticsTracing is compared +with the version provided in the appoptics_apm gem, so that the newer +version of the class can be used

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/graphql/tracing/appoptics_trace.rb', line 27
+
+def self.version
+  Gem::Version.new('1.0.0')
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #authorized(**data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+
+
# File 'lib/graphql/tracing/appoptics_trace.rb', line 88
+
+def authorized(**data)
+  return super if !defined?(AppOpticsAPM) || gql_config[:enabled] == false
+  layer = @platform_key_cache[AppOpticsTrace].platform_authorized_key_cache[data[:type]]
+  kvs = (data, layer)
+
+  ::AppOpticsAPM::SDK.trace(layer, kvs) do
+    kvs.clear # we don't have to send them twice
+    super
+  end
+end
+
+
+ +
+

+ + #authorized_lazy(**data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+
+
# File 'lib/graphql/tracing/appoptics_trace.rb', line 99
+
+def authorized_lazy(**data)
+  return super if !defined?(AppOpticsAPM) || gql_config[:enabled] == false
+  layer = @platform_key_cache[AppOpticsTrace].platform_authorized_key_cache[data[:type]]
+  kvs = (data, layer)
+
+  ::AppOpticsAPM::SDK.trace(layer, kvs) do
+    kvs.clear # we don't have to send them twice
+    super
+  end
+end
+
+
+ +
+

+ + #execute_field(query:, field:, ast_node:, arguments:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+
+
# File 'lib/graphql/tracing/appoptics_trace.rb', line 58
+
+def execute_field(query:, field:, ast_node:, arguments:, object:)
+  return_type = field.type.unwrap
+  trace_field = if return_type.kind.scalar? || return_type.kind.enum?
+    (field.trace.nil? && @trace_scalars) || field.trace
+  else
+    true
+  end
+  platform_key = if trace_field
+    @platform_key_cache[AppOpticsTrace].platform_field_key_cache[field]
+  else
+    nil
+  end
+  if platform_key && trace_field
+    return super if !defined?(AppOpticsAPM) || gql_config[:enabled] == false
+    layer = platform_key
+    kvs = ({query: query, field: field, ast_node: ast_node, arguments: arguments, object: object}, layer)
+
+    ::AppOpticsAPM::SDK.trace(layer, kvs) do
+      kvs.clear # we don't have to send them twice
+      super
+    end
+  else
+    super
+  end
+end
+
+
+ +
+

+ + #execute_field_lazy(query:, field:, ast_node:, arguments:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+84
+85
+86
+
+
# File 'lib/graphql/tracing/appoptics_trace.rb', line 84
+
+def execute_field_lazy(query:, field:, ast_node:, arguments:, object:)
+  execute_field(query: query, field: field, ast_node: ast_node, arguments: arguments, object: object)
+end
+
+
+ +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+139
+140
+141
+
+
# File 'lib/graphql/tracing/appoptics_trace.rb', line 139
+
+def platform_authorized_key(type)
+  "graphql.authorized.#{type.graphql_name}"
+end
+
+
+ +
+

+ + #platform_field_key(field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+135
+136
+137
+
+
# File 'lib/graphql/tracing/appoptics_trace.rb', line 135
+
+def platform_field_key(field)
+  "graphql.#{field.owner.graphql_name}.#{field.graphql_name}"
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+143
+144
+145
+
+
# File 'lib/graphql/tracing/appoptics_trace.rb', line 143
+
+def platform_resolve_type_key(type)
+  "graphql.resolve_type.#{type.graphql_name}"
+end
+
+
+ +
+

+ + #resolve_type(**data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+
+
# File 'lib/graphql/tracing/appoptics_trace.rb', line 110
+
+def resolve_type(**data)
+  return super if !defined?(AppOpticsAPM) || gql_config[:enabled] == false
+  layer = @platform_key_cache[AppOpticsTrace].platform_resolve_type_key_cache[data[:type]]
+
+  kvs = (data, layer)
+
+  ::AppOpticsAPM::SDK.trace(layer, kvs) do
+    kvs.clear # we don't have to send them twice
+    super
+  end
+end
+
+
+ +
+

+ + #resolve_type_lazy(**data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
+
# File 'lib/graphql/tracing/appoptics_trace.rb', line 122
+
+def resolve_type_lazy(**data)
+  return super if !defined?(AppOpticsAPM) || gql_config[:enabled] == false
+  layer = @platform_key_cache[AppOpticsTrace].platform_resolve_type_key_cache[data[:type]]
+  kvs = (data, layer)
+
+  ::AppOpticsAPM::SDK.trace(layer, kvs) do
+    kvs.clear # we don't have to send them twice
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/AppOpticsTracing.html b/api-doc/2.1.6/GraphQL/Tracing/AppOpticsTracing.html new file mode 100644 index 0000000000..5dadd708b8 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/AppOpticsTracing.html @@ -0,0 +1,533 @@ + + + + + + + Class: GraphQL::Tracing::AppOpticsTracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::AppOpticsTracing + + + +

+
+ +
+
Inherits:
+
+ PlatformTracing + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/appoptics_tracing.rb
+
+ +
+ +

Overview

+
+

This class uses the AppopticsAPM SDK from the appoptics_apm gem to create +traces for GraphQL.

+ +

There are 4 configurations available. They can be set in the +appoptics_apm config file or in code. Please see: +https://docs.appoptics.com/kb/apm_tracing/ruby/configure

+ +
AppOpticsAPM::Config[:graphql][:enabled] = true|false
+AppOpticsAPM::Config[:graphql][:transaction_name]  = true|false
+AppOpticsAPM::Config[:graphql][:sanitize_query] = true|false
+AppOpticsAPM::Config[:graphql][:remove_comments] = true|false
+
+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
PREP_KEYS = +
+
+

These GraphQL events will show up as ‘graphql.prep’ spans

+ + +
+
+
+ + +
+
+
['lex', 'parse', 'validate', 'analyze_query', 'analyze_multiplex'].freeze
+ +
EXEC_KEYS = +
+
+

These GraphQL events will show up as ‘graphql.execute’ spans

+ + +
+
+
+ + +
+
+
['execute_multiplex', 'execute_query', 'execute_query_lazy'].freeze
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ +
    + +
  • + + + .version ⇒ Object + + + + + + + + + + + + + +

    During auto-instrumentation this version of AppOpticsTracing is compared with the version provided in the appoptics_apm gem, so that the newer version of the class can be used.

    +
    + +
  • + + +
+ +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from PlatformTracing

+

#initialize, #trace, use

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Tracing::PlatformTracing

+ +
+ + +
+

Class Method Details

+ + +
+

+ + .versionObject + + + + + +

+
+

During auto-instrumentation this version of AppOpticsTracing is compared +with the version provided in the appoptics_apm gem, so that the newer +version of the class can be used

+ + +
+
+
+ + +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/graphql/tracing/appoptics_tracing.rb', line 27
+
+def self.version
+  Gem::Version.new('1.0.0')
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+61
+62
+63
+
+
# File 'lib/graphql/tracing/appoptics_tracing.rb', line 61
+
+def platform_authorized_key(type)
+  "graphql.authorized.#{type.graphql_name}"
+end
+
+
+ +
+

+ + #platform_field_key(type, field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/graphql/tracing/appoptics_tracing.rb', line 57
+
+def platform_field_key(type, field)
+  "graphql.#{type.graphql_name}.#{field.graphql_name}"
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+65
+66
+67
+
+
# File 'lib/graphql/tracing/appoptics_tracing.rb', line 65
+
+def platform_resolve_type_key(type)
+  "graphql.resolve_type.#{type.graphql_name}"
+end
+
+
+ +
+

+ + #platform_trace(platform_key, _key, data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
+
# File 'lib/graphql/tracing/appoptics_tracing.rb', line 42
+
+def platform_trace(platform_key, _key, data)
+  return yield if !defined?(AppOpticsAPM) || gql_config[:enabled] == false
+
+  layer = span_name(platform_key)
+  kvs = (data, layer)
+  kvs[:Key] = platform_key if (PREP_KEYS + EXEC_KEYS).include?(platform_key)
+
+  transaction_name(kvs[:InboundQuery]) if kvs[:InboundQuery] && layer == 'graphql.execute'
+
+  ::AppOpticsAPM::SDK.trace(layer, kvs) do
+    kvs.clear # we don't have to send them twice
+    yield
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/AppsignalTrace.html b/api-doc/2.1.6/GraphQL/Tracing/AppsignalTrace.html new file mode 100644 index 0000000000..3ad93e6958 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/AppsignalTrace.html @@ -0,0 +1,556 @@ + + + + + + + Module: GraphQL::Tracing::AppsignalTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::AppsignalTrace + + + +

+
+ + + + + + +
+
Includes:
+
PlatformTrace
+
+ + + + + + +
+
Defined in:
+
lib/graphql/tracing/appsignal_trace.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from PlatformTrace

+

#platform_authorized_lazy, #platform_execute_field_lazy, #platform_resolve_type_lazy

+ + +
+

Instance Method Details

+ + +
+

+ + #initialize(set_action_name: false, **rest) ⇒ Object + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + set_action_name + + + (Boolean) + + + (defaults to: false) + + + — +

    If true, the GraphQL operation name will be used as the transaction name. +This is not advised if you run more than one query per HTTP request, for example, with graphql-client or multiplexing. +It can also be specified per-query with context[:set_appsignal_action_name].

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+
+
# File 'lib/graphql/tracing/appsignal_trace.rb', line 11
+
+def initialize(set_action_name: false, **rest)
+  @set_action_name = set_action_name
+  super
+end
+
+
+ +
+

+ + #platform_authorized(platform_key) ⇒ Object + + + + + +

+ + + + +
+
+
+
+52
+53
+54
+55
+56
+
+
# File 'lib/graphql/tracing/appsignal_trace.rb', line 52
+
+def platform_authorized(platform_key)
+  Appsignal.instrument(platform_key) do
+    yield
+  end
+end
+
+
+ +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+68
+69
+70
+
+
# File 'lib/graphql/tracing/appsignal_trace.rb', line 68
+
+def platform_authorized_key(type)
+  "#{type.graphql_name}.authorized.graphql"
+end
+
+
+ +
+

+ + #platform_execute_field(platform_key) ⇒ Object + + + + + +

+ + + + +
+
+
+
+46
+47
+48
+49
+50
+
+
# File 'lib/graphql/tracing/appsignal_trace.rb', line 46
+
+def platform_execute_field(platform_key)
+  Appsignal.instrument(platform_key) do
+    yield
+  end
+end
+
+
+ +
+

+ + #platform_field_key(field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+64
+65
+66
+
+
# File 'lib/graphql/tracing/appsignal_trace.rb', line 64
+
+def platform_field_key(field)
+  "#{field.owner.graphql_name}.#{field.graphql_name}.graphql"
+end
+
+
+ +
+

+ + #platform_resolve_type(platform_key) ⇒ Object + + + + + +

+ + + + +
+
+
+
+58
+59
+60
+61
+62
+
+
# File 'lib/graphql/tracing/appsignal_trace.rb', line 58
+
+def platform_resolve_type(platform_key)
+  Appsignal.instrument(platform_key) do
+    yield
+  end
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+72
+73
+74
+
+
# File 'lib/graphql/tracing/appsignal_trace.rb', line 72
+
+def platform_resolve_type_key(type)
+  "#{type.graphql_name}.resolve_type.graphql"
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/AppsignalTracing.html b/api-doc/2.1.6/GraphQL/Tracing/AppsignalTracing.html new file mode 100644 index 0000000000..b654295843 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/AppsignalTracing.html @@ -0,0 +1,473 @@ + + + + + + + Class: GraphQL::Tracing::AppsignalTracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::AppsignalTracing + + + +

+
+ +
+
Inherits:
+
+ PlatformTracing + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/appsignal_tracing.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from PlatformTracing

+

#trace, use

+
+

Constructor Details

+ +
+

+ + #initialize(options = {}) ⇒ AppsignalTracing + + + + + +

+
+

Returns a new instance of AppsignalTracing.

+ + +
+
+
+

Parameters:

+
    + +
  • + + set_action_name + + + (Boolean) + + + + — +

    If true, the GraphQL operation name will be used as the transaction name. +This is not advised if you run more than one query per HTTP request, for example, with graphql-client or multiplexing. +It can also be specified per-query with context[:set_appsignal_action_name].

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+20
+21
+22
+23
+
+
# File 'lib/graphql/tracing/appsignal_tracing.rb', line 20
+
+def initialize(options = {})
+  @set_action_name = options.fetch(:set_action_name, false)
+  super
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+42
+43
+44
+
+
# File 'lib/graphql/tracing/appsignal_tracing.rb', line 42
+
+def platform_authorized_key(type)
+  "#{type.graphql_name}.authorized.graphql"
+end
+
+
+ +
+

+ + #platform_field_key(type, field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+38
+39
+40
+
+
# File 'lib/graphql/tracing/appsignal_tracing.rb', line 38
+
+def platform_field_key(type, field)
+  "#{type.graphql_name}.#{field.graphql_name}.graphql"
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+46
+47
+48
+
+
# File 'lib/graphql/tracing/appsignal_tracing.rb', line 46
+
+def platform_resolve_type_key(type)
+  "#{type.graphql_name}.resolve_type.graphql"
+end
+
+
+ +
+

+ + #platform_trace(platform_key, key, data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
+
# File 'lib/graphql/tracing/appsignal_tracing.rb', line 25
+
+def platform_trace(platform_key, key, data)
+  if key == "execute_query"
+    set_this_txn_name =  data[:query].context[:set_appsignal_action_name]
+    if set_this_txn_name == true || (set_this_txn_name.nil? && @set_action_name)
+      Appsignal::Transaction.current.set_action(transaction_name(data[:query]))
+    end
+  end
+
+  Appsignal.instrument(platform_key) do
+    yield
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/CallLegacyTracers.html b/api-doc/2.1.6/GraphQL/Tracing/CallLegacyTracers.html new file mode 100644 index 0000000000..e1f2254f3e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/CallLegacyTracers.html @@ -0,0 +1,881 @@ + + + + + + + Module: GraphQL::Tracing::CallLegacyTracers + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::CallLegacyTracers + + + +

+
+ + + + + + + + + +
+
Included in:
+
LegacyTrace
+
+ + + +
+
Defined in:
+
lib/graphql/tracing/legacy_trace.rb
+
+ +
+ +

Overview

+
+

This trace class calls legacy-style tracer with payload hashes. +New-style trace_with modules significantly reduce the overhead of tracing, +but that advantage is lost when legacy-style tracers are also used (since the payload hashes are still constructed).

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #analyze_multiplex(multiplex:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 20
+
+def analyze_multiplex(multiplex:)
+  multiplex.trace("analyze_multiplex", { multiplex: multiplex }) { super }
+end
+
+
+ +
+

+ + #analyze_query(query:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 24
+
+def analyze_query(query:)
+  query.trace("analyze_query", { query: query }) { super }
+end
+
+
+ +
+

+ + #authorized(query:, type:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 48
+
+def authorized(query:, type:, object:)
+  query.trace("authorized", { context: query.context, type: type, object: object, path: query.context[:current_path] }) { super }
+end
+
+
+ +
+

+ + #authorized_lazy(query:, type:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+52
+53
+54
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 52
+
+def authorized_lazy(query:, type:, object:)
+  query.trace("authorized_lazy", { context: query.context, type: type, object: object, path: query.context[:current_path] }) { super }
+end
+
+
+ +
+

+ + #execute_field(field:, query:, ast_node:, arguments:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+40
+41
+42
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 40
+
+def execute_field(field:, query:, ast_node:, arguments:, object:)
+  query.trace("execute_field", { field: field, query: query, ast_node: ast_node, arguments: arguments, object: object, owner: field.owner, path: query.context[:current_path] }) { super }
+end
+
+
+ +
+

+ + #execute_field_lazy(field:, query:, ast_node:, arguments:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 44
+
+def execute_field_lazy(field:, query:, ast_node:, arguments:, object:)
+  query.trace("execute_field_lazy", { field: field, query: query, ast_node: ast_node, arguments: arguments, object: object, owner: field.owner, path: query.context[:current_path] }) { super }
+end
+
+
+ +
+

+ + #execute_multiplex(multiplex:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 28
+
+def execute_multiplex(multiplex:)
+  multiplex.trace("execute_multiplex", { multiplex: multiplex }) { super }
+end
+
+
+ +
+

+ + #execute_query(query:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 32
+
+def execute_query(query:)
+  query.trace("execute_query", { query: query }) { super }
+end
+
+
+ +
+

+ + #execute_query_lazy(query:, multiplex:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 36
+
+def execute_query_lazy(query:, multiplex:)
+  multiplex.trace("execute_query_lazy", { multiplex: multiplex, query: query }) { super }
+end
+
+
+ +
+

+ + #lex(query_string:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 8
+
+def lex(query_string:)
+  (@multiplex || @query).trace("lex", { query_string: query_string }) { super }
+end
+
+
+ +
+

+ + #parse(query_string:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 12
+
+def parse(query_string:)
+  (@multiplex || @query).trace("parse", { query_string: query_string }) { super }
+end
+
+
+ +
+

+ + #resolve_type(query:, type:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+56
+57
+58
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 56
+
+def resolve_type(query:, type:, object:)
+  query.trace("resolve_type", { context: query.context, type: type, object: object, path: query.context[:current_path] }) { super }
+end
+
+
+ +
+

+ + #resolve_type_lazy(query:, type:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+60
+61
+62
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 60
+
+def resolve_type_lazy(query:, type:, object:)
+  query.trace("resolve_type_lazy", { context: query.context, type: type, object: object, path: query.context[:current_path] }) { super }
+end
+
+
+ +
+

+ + #validate(query:, validate:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/tracing/legacy_trace.rb', line 16
+
+def validate(query:, validate:)
+  query.trace("validate", { validate: validate, query: query }) { super }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/DataDogTrace.html b/api-doc/2.1.6/GraphQL/Tracing/DataDogTrace.html new file mode 100644 index 0000000000..3e9fd3e108 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/DataDogTrace.html @@ -0,0 +1,1082 @@ + + + + + + + Module: GraphQL::Tracing::DataDogTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::DataDogTrace + + + +

+
+ + + + + + +
+
Includes:
+
PlatformTrace
+
+ + + + + + +
+
Defined in:
+
lib/graphql/tracing/data_dog_trace.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from PlatformTrace

+

#platform_authorized_lazy, #platform_execute_field_lazy, #platform_resolve_type_lazy

+ + +
+

Instance Method Details

+ + +
+

+ + #authorized(query:, type:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+120
+121
+122
+123
+124
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 120
+
+def authorized(query:, type:, object:)
+  authorized_span("authorized", object, type, query) do
+    super(query: query, type: type, object: object)
+  end
+end
+
+
+ +
+

+ + #authorized_lazy(object:, type:, query:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+141
+142
+143
+144
+145
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 141
+
+def authorized_lazy(object:, type:, query:)
+  authorized_span("authorized_lazy", object, type, query) do
+    super(query: query, type: type, object: object)
+  end
+end
+
+
+ +
+

+ + #authorized_span(span_key, object, type, query) ⇒ Object + + + + + +

+ + + + +
+
+
+
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 126
+
+def authorized_span(span_key, object, type, query)
+  platform_key = @platform_key_cache[DataDogTrace].platform_authorized_key_cache[type]
+  @tracer.trace(platform_key, service: @service_name) do |span|
+    span.span_type = 'custom'
+    if defined?(Datadog::Tracing::Metadata::Ext) # Introduced in ddtrace 1.0
+      span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT, 'graphql')
+      span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, span_key)
+    end
+    if @has_prepare_span
+      prepare_span(span_key, {object: object, type: type, query: query}, span)
+    end
+    yield
+  end
+end
+
+
+ +
+

+ + #execute_field(query:, field:, ast_node:, arguments:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+108
+109
+110
+111
+112
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 108
+
+def execute_field(query:, field:, ast_node:, arguments:, object:)
+  execute_field_span("execute_field", query, field, ast_node, arguments, object) do
+    super(query: query, field: field, ast_node: ast_node, arguments: arguments, object: object)
+  end
+end
+
+
+ +
+

+ + #execute_field_lazy(query:, field:, ast_node:, arguments:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+114
+115
+116
+117
+118
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 114
+
+def execute_field_lazy(query:, field:, ast_node:, arguments:, object:)
+  execute_field_span("execute_field_lazy", query, field, ast_node, arguments, object) do
+    super(query: query, field: field, ast_node: ast_node, arguments: arguments, object: object)
+  end
+end
+
+
+ +
+

+ + #execute_field_span(span_key, query, field, ast_node, arguments, object) ⇒ Object + + + + + +

+ + + + +
+
+
+
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 79
+
+def execute_field_span(span_key, query, field, ast_node, arguments, object)
+  return_type = field.type.unwrap
+  trace_field = if return_type.kind.scalar? || return_type.kind.enum?
+    (field.trace.nil? && @trace_scalars) || field.trace
+  else
+    true
+  end
+  platform_key = if trace_field
+    @platform_key_cache[DataDogTrace].platform_field_key_cache[field]
+  else
+    nil
+  end
+  if platform_key && trace_field
+    @tracer.trace(platform_key, service: @service_name) do |span|
+      span.span_type = 'custom'
+      if defined?(Datadog::Tracing::Metadata::Ext) # Introduced in ddtrace 1.0
+        span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT, 'graphql')
+        span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, span_key)
+      end
+      if @has_prepare_span
+        prepare_span_data = { query: query, field: field, ast_node: ast_node, arguments: arguments, object: object }
+        prepare_span(span_key, prepare_span_data, span)
+      end
+      yield
+    end
+  else
+    yield
+  end
+end
+
+
+ +
+

+ + #initialize(tracer: nil, analytics_enabled: false, analytics_sample_rate: 1.0, service: "ruby-graphql", **rest) ⇒ Object + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + analytics_enabled + + + (Boolean) + + + (defaults to: false) + + + — +

    Deprecated

    +
    + +
  • + +
  • + + analytics_sample_rate + + + (Float) + + + (defaults to: 1.0) + + + — +

    Deprecated

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 8
+
+def initialize(tracer: nil, analytics_enabled: false, analytics_sample_rate: 1.0, service: "ruby-graphql", **rest)
+  if tracer.nil?
+    tracer = defined?(Datadog::Tracing) ? Datadog::Tracing : Datadog.tracer
+  end
+  @tracer = tracer
+
+  analytics_available = defined?(Datadog::Contrib::Analytics) \
+      && Datadog::Contrib::Analytics.respond_to?(:enabled?) \
+      && Datadog::Contrib::Analytics.respond_to?(:set_sample_rate)
+
+  @analytics_enabled = analytics_available && Datadog::Contrib::Analytics.enabled?(analytics_enabled)
+  @analytics_sample_rate = analytics_sample_rate
+  @service_name = service
+  @has_prepare_span = respond_to?(:prepare_span)
+  super
+end
+
+
+ +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+187
+188
+189
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 187
+
+def platform_authorized_key(type)
+  "#{type.graphql_name}.authorized"
+end
+
+
+ +
+

+ + #platform_field_key(field) ⇒ Object + + + + + +

+
+

Implement this method in a subclass to apply custom tags to datadog spans +def prepare_span(key, data, span) +end

+ + +
+
+
+

Parameters:

+
    + +
  • + + key + + + (String) + + + + — +

    The event being traced

    +
    + +
  • + +
  • + + data + + + (Hash) + + + + — +

    The runtime data for this event (@see GraphQL::Tracing for keys for each event)

    +
    + +
  • + +
  • + + span + + + (Datadog::Tracing::SpanOperation) + + + + — +

    The datadog span for this event

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+183
+184
+185
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 183
+
+def platform_field_key(field)
+  field.path
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+191
+192
+193
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 191
+
+def platform_resolve_type_key(type)
+  "#{type.graphql_name}.resolve_type"
+end
+
+
+ +
+

+ + #resolve_type(object:, type:, query:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+147
+148
+149
+150
+151
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 147
+
+def resolve_type(object:, type:, query:)
+  resolve_type_span("resolve_type", object, type, query) do
+    super(object: object, query: query, type: type)
+  end
+end
+
+
+ +
+

+ + #resolve_type_lazy(object:, type:, query:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+153
+154
+155
+156
+157
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 153
+
+def resolve_type_lazy(object:, type:, query:)
+  resolve_type_span("resolve_type_lazy", object, type, query) do
+    super(object: object, query: query, type: type)
+  end
+end
+
+
+ +
+

+ + #resolve_type_span(span_key, object, type, query) ⇒ Object + + + + + +

+ + + + +
+
+
+
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+
+
# File 'lib/graphql/tracing/data_dog_trace.rb', line 159
+
+def resolve_type_span(span_key, object, type, query)
+  platform_key = @platform_key_cache[DataDogTrace].platform_resolve_type_key_cache[type]
+  @tracer.trace(platform_key, service: @service_name) do |span|
+    span.span_type = 'custom'
+    if defined?(Datadog::Tracing::Metadata::Ext) # Introduced in ddtrace 1.0
+      span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT, 'graphql')
+      span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, span_key)
+    end
+    if @has_prepare_span
+      prepare_span(span_key, {object: object, type: type, query: query}, span)
+    end
+    yield
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/DataDogTracing.html b/api-doc/2.1.6/GraphQL/Tracing/DataDogTracing.html new file mode 100644 index 0000000000..2d6942d42e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/DataDogTracing.html @@ -0,0 +1,868 @@ + + + + + + + Class: GraphQL::Tracing::DataDogTracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::DataDogTracing + + + +

+
+ +
+
Inherits:
+
+ PlatformTracing + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/data_dog_tracing.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from PlatformTracing

+

#initialize, #trace, use

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Tracing::PlatformTracing

+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #analytics_available?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+71
+72
+73
+74
+75
+
+
# File 'lib/graphql/tracing/data_dog_tracing.rb', line 71
+
+def analytics_available?
+  defined?(Datadog::Contrib::Analytics) \
+    && Datadog::Contrib::Analytics.respond_to?(:enabled?) \
+    && Datadog::Contrib::Analytics.respond_to?(:set_sample_rate)
+end
+
+
+ +
+

+ + #analytics_enabled?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+77
+78
+79
+80
+
+
# File 'lib/graphql/tracing/data_dog_tracing.rb', line 77
+
+def analytics_enabled?
+  # [Deprecated] options[:analytics_enabled] will be removed in the future
+  analytics_available? && Datadog::Contrib::Analytics.enabled?(options.fetch(:analytics_enabled, false))
+end
+
+
+ +
+

+ + #analytics_sample_rateObject + + + + + +

+ + + + +
+
+
+
+82
+83
+84
+85
+
+
# File 'lib/graphql/tracing/data_dog_tracing.rb', line 82
+
+def analytics_sample_rate
+  # [Deprecated] options[:analytics_sample_rate] will be removed in the future
+  options.fetch(:analytics_sample_rate, 1.0)
+end
+
+
+ +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+91
+92
+93
+
+
# File 'lib/graphql/tracing/data_dog_tracing.rb', line 91
+
+def platform_authorized_key(type)
+  "#{type.graphql_name}.authorized"
+end
+
+
+ +
+

+ + #platform_field_key(type, field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+87
+88
+89
+
+
# File 'lib/graphql/tracing/data_dog_tracing.rb', line 87
+
+def platform_field_key(type, field)
+  "#{type.graphql_name}.#{field.graphql_name}"
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+95
+96
+97
+
+
# File 'lib/graphql/tracing/data_dog_tracing.rb', line 95
+
+def platform_resolve_type_key(type)
+  "#{type.graphql_name}.resolve_type"
+end
+
+
+ +
+

+ + #platform_trace(platform_key, key, data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
+
# File 'lib/graphql/tracing/data_dog_tracing.rb', line 17
+
+def platform_trace(platform_key, key, data)
+  tracer.trace(platform_key, service: service_name) do |span|
+    span.span_type = 'custom'
+    if defined?(Datadog::Tracing::Metadata::Ext) # Introduced in ddtrace 1.0
+      span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT, 'graphql')
+      span.set_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION, key)
+    end
+
+    if key == 'execute_multiplex'
+      operations = data[:multiplex].queries.map(&:selected_operation_name).join(', ')
+
+      resource = if operations.empty?
+        first_query = data[:multiplex].queries.first
+        fallback_transaction_name(first_query && first_query.context)
+      else
+        operations
+      end
+      span.resource = resource if resource
+
+      # For top span of query, set the analytics sample rate tag, if available.
+      if analytics_enabled?
+        Datadog::Contrib::Analytics.set_sample_rate(span, analytics_sample_rate)
+      end
+    end
+
+    if key == 'execute_query'
+      span.set_tag(:selected_operation_name, data[:query].selected_operation_name)
+      span.set_tag(:selected_operation_type, data[:query].selected_operation.operation_type)
+      span.set_tag(:query_string, data[:query].query_string)
+    end
+
+    prepare_span(key, data, span)
+
+    yield
+  end
+end
+
+
+ +
+

+ + #prepare_span(key, data, span) ⇒ Object + + + + + +

+
+

Implement this method in a subclass to apply custom tags to datadog spans

+ + +
+
+
+

Parameters:

+
    + +
  • + + key + + + (String) + + + + — +

    The event being traced

    +
    + +
  • + +
  • + + data + + + (Hash) + + + + — +

    The runtime data for this event (@see GraphQL::Tracing for keys for each event)

    +
    + +
  • + +
  • + + span + + + (Datadog::Tracing::SpanOperation) + + + + — +

    The datadog span for this event

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+62
+63
+
+
# File 'lib/graphql/tracing/data_dog_tracing.rb', line 62
+
+def prepare_span(key, data, span)
+end
+
+
+ +
+

+ + #service_nameObject + + + + + +

+ + + + +
+
+
+
+54
+55
+56
+
+
# File 'lib/graphql/tracing/data_dog_tracing.rb', line 54
+
+def service_name
+  options.fetch(:service, 'ruby-graphql')
+end
+
+
+ +
+

+ + #tracerObject + + + + + +

+ + + + +
+
+
+
+65
+66
+67
+68
+69
+
+
# File 'lib/graphql/tracing/data_dog_tracing.rb', line 65
+
+def tracer
+  default_tracer = defined?(Datadog::Tracing) ? Datadog::Tracing : Datadog.tracer
+
+  options.fetch(:tracer, default_tracer)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/LegacyTrace.html b/api-doc/2.1.6/GraphQL/Tracing/LegacyTrace.html new file mode 100644 index 0000000000..e15f7471e7 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/LegacyTrace.html @@ -0,0 +1,156 @@ + + + + + + + Class: GraphQL::Tracing::LegacyTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::LegacyTrace + + + +

+
+ +
+
Inherits:
+
+ Trace + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
CallLegacyTracers
+
+ + + + + + +
+
Defined in:
+
lib/graphql/tracing/legacy_trace.rb
+
+ +
+ + + + + + + + + + + + + + + +

Method Summary

+ +

Methods included from CallLegacyTracers

+

#analyze_multiplex, #analyze_query, #authorized, #authorized_lazy, #execute_field, #execute_field_lazy, #execute_multiplex, #execute_query, #execute_query_lazy, #lex, #parse, #resolve_type, #resolve_type_lazy, #validate

+ + + + + + + + + +

Methods inherited from Trace

+

#analyze_multiplex, #analyze_query, #authorized, #authorized_lazy, #execute_field, #execute_field_lazy, #execute_multiplex, #execute_query, #execute_query_lazy, #initialize, #lex, #parse, #resolve_type, #resolve_type_lazy, #validate

+
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Tracing::Trace

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/NewRelicTrace.html b/api-doc/2.1.6/GraphQL/Tracing/NewRelicTrace.html new file mode 100644 index 0000000000..27157b21ec --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/NewRelicTrace.html @@ -0,0 +1,621 @@ + + + + + + + Module: GraphQL::Tracing::NewRelicTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::NewRelicTrace + + + +

+
+ + + + + + +
+
Includes:
+
PlatformTrace
+
+ + + + + + +
+
Defined in:
+
lib/graphql/tracing/new_relic_trace.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from PlatformTrace

+

#platform_authorized_lazy, #platform_execute_field_lazy, #platform_resolve_type_lazy

+ + +
+

Instance Method Details

+ + +
+

+ + #execute_query(query:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'lib/graphql/tracing/new_relic_trace.rb', line 16
+
+def execute_query(query:)
+  set_this_txn_name =  query.context[:set_new_relic_transaction_name]
+  if set_this_txn_name == true || (set_this_txn_name.nil? && @set_transaction_name)
+    NewRelic::Agent.set_transaction_name(transaction_name(query))
+  end
+  NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped("GraphQL/execute") do
+    super
+  end
+end
+
+
+ +
+

+ + #initialize(set_transaction_name: false, **_rest) ⇒ Object + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + set_transaction_name + + + (Boolean) + + + (defaults to: false) + + + — +

    If true, the GraphQL operation name will be used as the transaction name. +This is not advised if you run more than one query per HTTP request, for example, with graphql-client or multiplexing. +It can also be specified per-query with context[:set_new_relic_transaction_name].

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+11
+12
+13
+14
+
+
# File 'lib/graphql/tracing/new_relic_trace.rb', line 11
+
+def initialize(set_transaction_name: false, **_rest)
+  @set_transaction_name = set_transaction_name
+  super
+end
+
+
+ +
+

+ + #platform_authorized(platform_key) ⇒ Object + + + + + +

+ + + + +
+
+
+
+50
+51
+52
+53
+54
+
+
# File 'lib/graphql/tracing/new_relic_trace.rb', line 50
+
+def platform_authorized(platform_key)
+  NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped(platform_key) do
+    yield
+  end
+end
+
+
+ +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+66
+67
+68
+
+
# File 'lib/graphql/tracing/new_relic_trace.rb', line 66
+
+def platform_authorized_key(type)
+  "GraphQL/Authorize/#{type.graphql_name}"
+end
+
+
+ +
+

+ + #platform_execute_field(platform_key) ⇒ Object + + + + + +

+ + + + +
+
+
+
+44
+45
+46
+47
+48
+
+
# File 'lib/graphql/tracing/new_relic_trace.rb', line 44
+
+def platform_execute_field(platform_key)
+  NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped(platform_key) do
+    yield
+  end
+end
+
+
+ +
+

+ + #platform_field_key(field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+62
+63
+64
+
+
# File 'lib/graphql/tracing/new_relic_trace.rb', line 62
+
+def platform_field_key(field)
+  "GraphQL/#{field.owner.graphql_name}/#{field.graphql_name}"
+end
+
+
+ +
+

+ + #platform_resolve_type(platform_key) ⇒ Object + + + + + +

+ + + + +
+
+
+
+56
+57
+58
+59
+60
+
+
# File 'lib/graphql/tracing/new_relic_trace.rb', line 56
+
+def platform_resolve_type(platform_key)
+  NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped(platform_key) do
+    yield
+  end
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+70
+71
+72
+
+
# File 'lib/graphql/tracing/new_relic_trace.rb', line 70
+
+def platform_resolve_type_key(type)
+  "GraphQL/ResolveType/#{type.graphql_name}"
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/NewRelicTracing.html b/api-doc/2.1.6/GraphQL/Tracing/NewRelicTracing.html new file mode 100644 index 0000000000..ced26a4519 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/NewRelicTracing.html @@ -0,0 +1,473 @@ + + + + + + + Class: GraphQL::Tracing::NewRelicTracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::NewRelicTracing + + + +

+
+ +
+
Inherits:
+
+ PlatformTracing + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/new_relic_tracing.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from PlatformTracing

+

#trace, use

+
+

Constructor Details

+ +
+

+ + #initialize(options = {}) ⇒ NewRelicTracing + + + + + +

+
+

Returns a new instance of NewRelicTracing.

+ + +
+
+
+

Parameters:

+
    + +
  • + + set_transaction_name + + + (Boolean) + + + + — +

    If true, the GraphQL operation name will be used as the transaction name. +This is not advised if you run more than one query per HTTP request, for example, with graphql-client or multiplexing. +It can also be specified per-query with context[:set_new_relic_transaction_name].

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+20
+21
+22
+23
+
+
# File 'lib/graphql/tracing/new_relic_tracing.rb', line 20
+
+def initialize(options = {})
+  @set_transaction_name = options.fetch(:set_transaction_name, false)
+  super
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+42
+43
+44
+
+
# File 'lib/graphql/tracing/new_relic_tracing.rb', line 42
+
+def platform_authorized_key(type)
+  "GraphQL/Authorize/#{type.graphql_name}"
+end
+
+
+ +
+

+ + #platform_field_key(type, field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+38
+39
+40
+
+
# File 'lib/graphql/tracing/new_relic_tracing.rb', line 38
+
+def platform_field_key(type, field)
+  "GraphQL/#{type.graphql_name}/#{field.graphql_name}"
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+46
+47
+48
+
+
# File 'lib/graphql/tracing/new_relic_tracing.rb', line 46
+
+def platform_resolve_type_key(type)
+  "GraphQL/ResolveType/#{type.graphql_name}"
+end
+
+
+ +
+

+ + #platform_trace(platform_key, key, data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
+
# File 'lib/graphql/tracing/new_relic_tracing.rb', line 25
+
+def platform_trace(platform_key, key, data)
+  if key == "execute_query"
+    set_this_txn_name =  data[:query].context[:set_new_relic_transaction_name]
+    if set_this_txn_name == true || (set_this_txn_name.nil? && @set_transaction_name)
+      NewRelic::Agent.set_transaction_name(transaction_name(data[:query]))
+    end
+  end
+
+  NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped(platform_key) do
+    yield
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/NotificationsTrace.html b/api-doc/2.1.6/GraphQL/Tracing/NotificationsTrace.html new file mode 100644 index 0000000000..8aee7486cb --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/NotificationsTrace.html @@ -0,0 +1,239 @@ + + + + + + + Module: GraphQL::Tracing::NotificationsTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::NotificationsTrace + + + +

+
+ + + + + + +
+
Includes:
+
PlatformTrace
+
+ + + + +
+
Included in:
+
ActiveSupportNotificationsTrace
+
+ + + +
+
Defined in:
+
lib/graphql/tracing/notifications_trace.rb
+
+ +
+ +

Overview

+
+

This implementation forwards events to a notification handler (i.e. +ActiveSupport::Notifications or Dry::Monitor::Notifications) +with a graphql suffix.

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from PlatformTrace

+

#platform_authorized_lazy, #platform_execute_field_lazy, #platform_resolve_type_lazy

+ + +
+

Instance Method Details

+ + +
+

+ + #initialize(engine:, **rest) ⇒ Object + + + + + +

+
+

Initialize a new NotificationsTracing instance

+ + +
+
+
+

Parameters:

+
    + +
  • + + engine + + + (#instrument(key, metadata, block)) + + + + — +

    The notifications engine to use

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+14
+15
+16
+17
+
+
# File 'lib/graphql/tracing/notifications_trace.rb', line 14
+
+def initialize(engine:, **rest)
+  @notifications_engine = engine
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/NotificationsTracing.html b/api-doc/2.1.6/GraphQL/Tracing/NotificationsTracing.html new file mode 100644 index 0000000000..93b2175df3 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/NotificationsTracing.html @@ -0,0 +1,422 @@ + + + + + + + Class: GraphQL::Tracing::NotificationsTracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::NotificationsTracing + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/notifications_tracing.rb
+
+ +
+ +

Overview

+
+

This implementation forwards events to a notification handler (i.e. +ActiveSupport::Notifications or Dry::Monitor::Notifications) +with a graphql suffix.

+ + +
+
+
+ + +

See Also:

+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
KEYS = +
+
+

A cache of frequently-used keys to avoid needless string allocations

+ + +
+
+
+ + +
+
+
{
+  "lex" => "lex.graphql",
+  "parse" => "parse.graphql",
+  "validate" => "validate.graphql",
+  "analyze_multiplex" => "analyze_multiplex.graphql",
+  "analyze_query" => "analyze_query.graphql",
+  "execute_query" => "execute_query.graphql",
+  "execute_query_lazy" => "execute_query_lazy.graphql",
+  "execute_field" => "execute_field.graphql",
+  "execute_field_lazy" => "execute_field_lazy.graphql",
+  "authorized" => "authorized.graphql",
+  "authorized_lazy" => "authorized_lazy.graphql",
+  "resolve_type" => "resolve_type.graphql",
+  "resolve_type_lazy" => "resolve_type.graphql",
+}
+ +
MAX_KEYS_SIZE = + +
+
100
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(notifications_engine) ⇒ NotificationsTracing + + + + + +

+
+

Initialize a new NotificationsTracing instance

+ + +
+
+
+

Parameters:

+
    + +
  • + + notifications_engine + + + (Object) + + + + — +

    The notifications engine to use

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/tracing/notifications_tracing.rb', line 33
+
+def initialize(notifications_engine)
+  @notifications_engine = notifications_engine
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #trace(key, metadata) { ... } ⇒ Object + + + + + +

+
+

Sends a GraphQL tracing event to the notification handler

+ +

. notifications_engine = Dry::Monitor::Notifications.new(:graphql) +. tracer = GraphQL::Tracing::NotificationsTracing.new(notifications_engine) +. tracer.trace(“lex”) { … }

+ + +
+
+
+

Parameters:

+
    + +
  • + + key + + + (string) + + + + — +

    The key for the event

    +
    + +
  • + +
  • + + metadata + + + (Hash) + + + + — +

    The metadata for the event

    +
    + +
  • + +
+ +

Yields:

+
    + +
  • + + + + + + + +

    The block to execute for the event

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+
+
# File 'lib/graphql/tracing/notifications_tracing.rb', line 47
+
+def trace(key, , &blk)
+  prefixed_key = KEYS[key] || "#{key}.graphql"
+
+  # Cache the new keys while making sure not to induce a memory leak
+  if KEYS.size < MAX_KEYS_SIZE
+    KEYS[key] ||= prefixed_key
+  end
+
+  @notifications_engine.instrument(prefixed_key, , &blk)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/NullTracer.html b/api-doc/2.1.6/GraphQL/Tracing/NullTracer.html new file mode 100644 index 0000000000..d34e2b9a3d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/NullTracer.html @@ -0,0 +1,175 @@ + + + + + + + Module: GraphQL::Tracing::NullTracer + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::NullTracer + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing.rb
+
+ +
+ + + + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .trace(k, v) ⇒ Object + + + + + +

+ + + + +
+
+
+
+67
+68
+69
+
+
# File 'lib/graphql/tracing.rb', line 67
+
+def trace(k, v)
+  yield
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/PlatformTrace.html b/api-doc/2.1.6/GraphQL/Tracing/PlatformTrace.html new file mode 100644 index 0000000000..90b930f5e5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/PlatformTrace.html @@ -0,0 +1,355 @@ + + + + + + + Module: GraphQL::Tracing::PlatformTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::PlatformTrace + + + +

+
+ + + + + + + + + +
+
Included in:
+
AppOpticsTrace, AppsignalTrace, DataDogTrace, NewRelicTrace, NotificationsTrace, PrometheusTrace, ScoutTrace, StatsdTrace
+
+ + + +
+
Defined in:
+
lib/graphql/tracing/platform_trace.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: BaseKeyCache + + + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #initialize(trace_scalars: false, **_options) ⇒ Object + + + + + +

+ + + + +
+
+
+
+6
+7
+8
+9
+10
+11
+
+
# File 'lib/graphql/tracing/platform_trace.rb', line 6
+
+def initialize(trace_scalars: false, **_options)
+  @trace_scalars = trace_scalars
+
+  @platform_key_cache = Hash.new { |h, mod| h[mod] = mod::KeyCache.new }
+  super
+end
+
+
+ +
+

+ + #platform_authorized_lazy(key, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/graphql/tracing/platform_trace.rb', line 28
+
+def platform_authorized_lazy(key, &block)
+  platform_authorized(key, &block)
+end
+
+
+ +
+

+ + #platform_execute_field_lazy(*args, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/tracing/platform_trace.rb', line 24
+
+def platform_execute_field_lazy(*args, &block)
+  platform_execute_field(*args, &block)
+end
+
+
+ +
+

+ + #platform_resolve_type_lazy(key, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/graphql/tracing/platform_trace.rb', line 32
+
+def platform_resolve_type_lazy(key, &block)
+  platform_resolve_type(key, &block)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/PlatformTrace/BaseKeyCache.html b/api-doc/2.1.6/GraphQL/Tracing/PlatformTrace/BaseKeyCache.html new file mode 100644 index 0000000000..53ed084e27 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/PlatformTrace/BaseKeyCache.html @@ -0,0 +1,399 @@ + + + + + + + Module: GraphQL::Tracing::PlatformTrace::BaseKeyCache + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::PlatformTrace::BaseKeyCache + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/platform_trace.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #platform_authorized_key_cacheObject (readonly) + + + + + +

+
+

Returns the value of attribute platform_authorized_key_cache.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/tracing/platform_trace.rb', line 20
+
+def platform_authorized_key_cache
+  @platform_authorized_key_cache
+end
+
+
+ + + +
+

+ + #platform_field_key_cacheObject (readonly) + + + + + +

+
+

Returns the value of attribute platform_field_key_cache.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/tracing/platform_trace.rb', line 20
+
+def platform_field_key_cache
+  @platform_field_key_cache
+end
+
+
+ + + +
+

+ + #platform_resolve_type_key_cacheObject (readonly) + + + + + +

+
+

Returns the value of attribute platform_resolve_type_key_cache.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/tracing/platform_trace.rb', line 20
+
+def platform_resolve_type_key_cache
+  @platform_resolve_type_key_cache
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #initializeObject + + + + + +

+ + + + +
+
+
+
+14
+15
+16
+17
+18
+
+
# File 'lib/graphql/tracing/platform_trace.rb', line 14
+
+def initialize
+  @platform_field_key_cache = Hash.new { |h, k| h[k] = platform_field_key(k) }
+  @platform_authorized_key_cache = Hash.new { |h, k| h[k] = platform_authorized_key(k) }
+  @platform_resolve_type_key_cache = Hash.new { |h, k| h[k] = platform_resolve_type_key(k) }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/PlatformTracing.html b/api-doc/2.1.6/GraphQL/Tracing/PlatformTracing.html new file mode 100644 index 0000000000..db8d993089 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/PlatformTracing.html @@ -0,0 +1,585 @@ + + + + + + + Class: GraphQL::Tracing::PlatformTracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::PlatformTracing + + + Private +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/platform_tracing.rb
+
+ +
+ +

Overview

+
+

+ This class is part of a private API. + You should avoid using this class if possible, as it may be removed or be changed in the future. +

+

Each platform provides: +- .platform_keys +- #platform_trace +- #platform_field_key(type, field)

+ + +
+
+
+ + +
+ + + + +

Class Attribute Summary collapse

+ + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(options = {}) ⇒ PlatformTracing + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns a new instance of PlatformTracing.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+19
+20
+21
+22
+23
+
+
# File 'lib/graphql/tracing/platform_tracing.rb', line 19
+
+def initialize(options = {})
+  @options = options
+  @platform_keys = self.class.platform_keys
+  @trace_scalars = options.fetch(:trace_scalars, false)
+end
+
+
+ +
+ +
+

Class Attribute Details

+ + + +
+

+ + .platform_keysObject + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/tracing/platform_tracing.rb', line 12
+
+def platform_keys
+  @platform_keys
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .use(schema_defn, options = {}) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+
+
# File 'lib/graphql/tracing/platform_tracing.rb', line 75
+
+def self.use(schema_defn, options = {})
+  if options[:legacy_tracing]
+    tracer = self.new(**options)
+    schema_defn.tracer(tracer)
+  else
+    tracing_name = self.name.split("::").last
+    trace_name = tracing_name.sub("Tracing", "Trace")
+    if GraphQL::Tracing.const_defined?(trace_name, false)
+      trace_module = GraphQL::Tracing.const_get(trace_name)
+      schema_defn.trace_with(trace_module, **options)
+    else
+      tracer = self.new(**options)
+      schema_defn.tracer(tracer)
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #trace(key, data) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+ + + +
+
+
+ + +
+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+
+
# File 'lib/graphql/tracing/platform_tracing.rb', line 25
+
+def trace(key, data)
+  case key
+  when "lex", "parse", "validate", "analyze_query", "analyze_multiplex", "execute_query", "execute_query_lazy", "execute_multiplex"
+    platform_key = @platform_keys.fetch(key)
+    platform_trace(platform_key, key, data) do
+      yield
+    end
+  when "execute_field", "execute_field_lazy"
+    field = data[:field]
+    return_type = field.type.unwrap
+    trace_field = if return_type.kind.scalar? || return_type.kind.enum?
+      (field.trace.nil? && @trace_scalars) || field.trace
+    else
+      true
+    end
+
+    platform_key = if trace_field
+      context = data.fetch(:query).context
+      cached_platform_key(context, field, :field) { platform_field_key(field.owner, field) }
+    else
+      nil
+    end
+
+    if platform_key && trace_field
+      platform_trace(platform_key, key, data) do
+        yield
+      end
+    else
+      yield
+    end
+  when "authorized", "authorized_lazy"
+    type = data.fetch(:type)
+    context = data.fetch(:context)
+    platform_key = cached_platform_key(context, type, :authorized) { platform_authorized_key(type) }
+    platform_trace(platform_key, key, data) do
+      yield
+    end
+  when "resolve_type", "resolve_type_lazy"
+    type = data.fetch(:type)
+    context = data.fetch(:context)
+    platform_key = cached_platform_key(context, type, :resolve_type) { platform_resolve_type_key(type) }
+    platform_trace(platform_key, key, data) do
+      yield
+    end
+  else
+    # it's a custom key
+    yield
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/PrometheusTrace.html b/api-doc/2.1.6/GraphQL/Tracing/PrometheusTrace.html new file mode 100644 index 0000000000..cc72730d12 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/PrometheusTrace.html @@ -0,0 +1,671 @@ + + + + + + + Module: GraphQL::Tracing::PrometheusTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::PrometheusTrace + + + +

+
+ + + + + + +
+
Includes:
+
PlatformTrace
+
+ + + + + + +
+
Defined in:
+
lib/graphql/tracing/prometheus_trace.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + +
+

Instance Method Details

+ + +
+

+ + #initialize(client: PrometheusExporter::Client.default, keys_whitelist: ["execute_field", "execute_field_lazy"], collector_type: "graphql", **rest) ⇒ Object + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+
+
# File 'lib/graphql/tracing/prometheus_trace.rb', line 8
+
+def initialize(client: PrometheusExporter::Client.default, keys_whitelist: ["execute_field", "execute_field_lazy"], collector_type: "graphql", **rest)
+  @client = client
+  @keys_whitelist = keys_whitelist
+  @collector_type = collector_type
+
+  super(**rest)
+end
+
+
+ +
+

+ + #platform_authorized(platform_key, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'lib/graphql/tracing/prometheus_trace.rb', line 41
+
+def platform_authorized(platform_key, &block)
+  instrument_execution(platform_key, "authorized", &block)
+end
+
+
+ +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+61
+62
+63
+
+
# File 'lib/graphql/tracing/prometheus_trace.rb', line 61
+
+def platform_authorized_key(type)
+  "#{type.graphql_name}.authorized"
+end
+
+
+ +
+

+ + #platform_authorized_lazy(platform_key, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+45
+46
+47
+
+
# File 'lib/graphql/tracing/prometheus_trace.rb', line 45
+
+def platform_authorized_lazy(platform_key, &block)
+  instrument_execution(platform_key, "authorized_lazy", &block)
+end
+
+
+ +
+

+ + #platform_execute_field(platform_key, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/tracing/prometheus_trace.rb', line 33
+
+def platform_execute_field(platform_key, &block)
+  instrument_execution(platform_key, "execute_field", &block)
+end
+
+
+ +
+

+ + #platform_execute_field_lazy(platform_key, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'lib/graphql/tracing/prometheus_trace.rb', line 37
+
+def platform_execute_field_lazy(platform_key, &block)
+  instrument_execution(platform_key, "execute_field_lazy", &block)
+end
+
+
+ +
+

+ + #platform_field_key(field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/graphql/tracing/prometheus_trace.rb', line 57
+
+def platform_field_key(field)
+  field.path
+end
+
+
+ +
+

+ + #platform_resolve_type(platform_key, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+49
+50
+51
+
+
# File 'lib/graphql/tracing/prometheus_trace.rb', line 49
+
+def platform_resolve_type(platform_key, &block)
+  instrument_execution(platform_key, "resolve_type", &block)
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+65
+66
+67
+
+
# File 'lib/graphql/tracing/prometheus_trace.rb', line 65
+
+def platform_resolve_type_key(type)
+  "#{type.graphql_name}.resolve_type"
+end
+
+
+ +
+

+ + #platform_resolve_type_lazy(platform_key, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+53
+54
+55
+
+
# File 'lib/graphql/tracing/prometheus_trace.rb', line 53
+
+def platform_resolve_type_lazy(platform_key, &block)
+  instrument_execution(platform_key, "resolve_type_lazy", &block)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/PrometheusTracing.html b/api-doc/2.1.6/GraphQL/Tracing/PrometheusTracing.html new file mode 100644 index 0000000000..ec9e96a181 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/PrometheusTracing.html @@ -0,0 +1,475 @@ + + + + + + + Class: GraphQL::Tracing::PrometheusTracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::PrometheusTracing + + + +

+
+ +
+
Inherits:
+
+ PlatformTracing + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/prometheus_tracing.rb,
+ lib/graphql/tracing/prometheus_tracing/graphql_collector.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: GraphQLCollector + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
DEFAULT_WHITELIST = + +
+
['execute_field', 'execute_field_lazy'].freeze
+ +
DEFAULT_COLLECTOR_TYPE = + +
+
'graphql'.freeze
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from PlatformTracing

+

#trace, use

+
+

Constructor Details

+ +
+

+ + #initialize(opts = {}) ⇒ PrometheusTracing + + + + + +

+
+

Returns a new instance of PrometheusTracing.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+22
+23
+24
+25
+26
+27
+28
+
+
# File 'lib/graphql/tracing/prometheus_tracing.rb', line 22
+
+def initialize(opts = {})
+  @client = opts[:client] || PrometheusExporter::Client.default
+  @keys_whitelist = opts[:keys_whitelist] || DEFAULT_WHITELIST
+  @collector_type = opts[:collector_type] || DEFAULT_COLLECTOR_TYPE
+
+  super opts
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+39
+40
+41
+
+
# File 'lib/graphql/tracing/prometheus_tracing.rb', line 39
+
+def platform_authorized_key(type)
+  "#{type.graphql_name}.authorized"
+end
+
+
+ +
+

+ + #platform_field_key(type, field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+35
+36
+37
+
+
# File 'lib/graphql/tracing/prometheus_tracing.rb', line 35
+
+def platform_field_key(type, field)
+  "#{type.graphql_name}.#{field.graphql_name}"
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+43
+44
+45
+
+
# File 'lib/graphql/tracing/prometheus_tracing.rb', line 43
+
+def platform_resolve_type_key(type)
+  "#{type.graphql_name}.resolve_type"
+end
+
+
+ +
+

+ + #platform_trace(platform_key, key, _data, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+33
+
+
# File 'lib/graphql/tracing/prometheus_tracing.rb', line 30
+
+def platform_trace(platform_key, key, _data, &block)
+  return yield unless @keys_whitelist.include?(key)
+  instrument_execution(platform_key, key, &block)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/PrometheusTracing/GraphQLCollector.html b/api-doc/2.1.6/GraphQL/Tracing/PrometheusTracing/GraphQLCollector.html new file mode 100644 index 0000000000..c578274a3d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/PrometheusTracing/GraphQLCollector.html @@ -0,0 +1,383 @@ + + + + + + + Class: GraphQL::Tracing::PrometheusTracing::GraphQLCollector + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::PrometheusTracing::GraphQLCollector + + + +

+
+ +
+
Inherits:
+
+ PrometheusExporter::Server::TypeCollector + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/prometheus_tracing/graphql_collector.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Constructor Details

+ +
+

+ + #initializeGraphQLCollector + + + + + +

+
+

Returns a new instance of GraphQLCollector.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+
+
# File 'lib/graphql/tracing/prometheus_tracing/graphql_collector.rb', line 7
+
+def initialize
+  @graphql_gauge = PrometheusExporter::Metric::Base.default_aggregation.new(
+    'graphql_duration_seconds',
+    'Time spent in GraphQL operations, in seconds'
+  )
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #collect(object) ⇒ Object + + + + + +

+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+24
+
+
# File 'lib/graphql/tracing/prometheus_tracing/graphql_collector.rb', line 18
+
+def collect(object)
+  default_labels = { key: object['key'], platform_key: object['platform_key'] }
+  custom = object['custom_labels']
+  labels = custom.nil? ? default_labels : default_labels.merge(custom)
+
+  @graphql_gauge.observe object['duration'], labels
+end
+
+
+ +
+

+ + #metricsObject + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/tracing/prometheus_tracing/graphql_collector.rb', line 26
+
+def metrics
+  [@graphql_gauge]
+end
+
+
+ +
+

+ + #typeObject + + + + + +

+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/tracing/prometheus_tracing/graphql_collector.rb', line 14
+
+def type
+  'graphql'
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/ScoutTrace.html b/api-doc/2.1.6/GraphQL/Tracing/ScoutTrace.html new file mode 100644 index 0000000000..6313a5d174 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/ScoutTrace.html @@ -0,0 +1,515 @@ + + + + + + + Module: GraphQL::Tracing::ScoutTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::ScoutTrace + + + +

+
+ + + + + + +
+
Includes:
+
PlatformTrace
+
+ + + + + + +
+
Defined in:
+
lib/graphql/tracing/scout_trace.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
INSTRUMENT_OPTS = + +
+
{ scope: true }
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from PlatformTrace

+

#platform_authorized_lazy, #platform_execute_field_lazy, #platform_resolve_type_lazy

+ + +
+

Instance Method Details

+ + +
+

+ + #initialize(set_transaction_name: false, **_rest) ⇒ Object + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + set_transaction_name + + + (Boolean) + + + (defaults to: false) + + + — +

    If true, the GraphQL operation name will be used as the transaction name. +This is not advised if you run more than one query per HTTP request, for example, with graphql-client or multiplexing. +It can also be specified per-query with context[:set_scout_transaction_name].

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/tracing/scout_trace.rb', line 13
+
+def initialize(set_transaction_name: false, **_rest)
+  self.class.include(ScoutApm::Tracer)
+  @set_transaction_name = set_transaction_name
+  super
+end
+
+
+ +
+

+ + #platform_authorized(platform_key, &block) ⇒ Object + + + + Also known as: + platform_resolve_type + + + + +

+ + + + +
+
+
+
+53
+54
+55
+
+
# File 'lib/graphql/tracing/scout_trace.rb', line 53
+
+def platform_authorized(platform_key, &block)
+  self.class.instrument("GraphQL", platform_key, INSTRUMENT_OPTS, &block)
+end
+
+
+ +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+63
+64
+65
+
+
# File 'lib/graphql/tracing/scout_trace.rb', line 63
+
+def platform_authorized_key(type)
+  "#{type.graphql_name}.authorized"
+end
+
+
+ +
+

+ + #platform_execute_field(platform_key, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+49
+50
+51
+
+
# File 'lib/graphql/tracing/scout_trace.rb', line 49
+
+def platform_execute_field(platform_key, &block)
+  self.class.instrument("GraphQL", platform_key, INSTRUMENT_OPTS, &block)
+end
+
+
+ +
+

+ + #platform_field_key(field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+59
+60
+61
+
+
# File 'lib/graphql/tracing/scout_trace.rb', line 59
+
+def platform_field_key(field)
+  field.path
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+67
+68
+69
+
+
# File 'lib/graphql/tracing/scout_trace.rb', line 67
+
+def platform_resolve_type_key(type)
+  "#{type.graphql_name}.resolve_type"
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/ScoutTracing.html b/api-doc/2.1.6/GraphQL/Tracing/ScoutTracing.html new file mode 100644 index 0000000000..7cdcd7bfae --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/ScoutTracing.html @@ -0,0 +1,491 @@ + + + + + + + Class: GraphQL::Tracing::ScoutTracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::ScoutTracing + + + +

+
+ +
+
Inherits:
+
+ PlatformTracing + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/scout_tracing.rb
+
+ +
+ + + +

+ Constant Summary + collapse +

+ +
+ +
INSTRUMENT_OPTS = + +
+
{ scope: true }
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from PlatformTracing

+

#trace, use

+
+

Constructor Details

+ +
+

+ + #initialize(options = {}) ⇒ ScoutTracing + + + + + +

+
+

Returns a new instance of ScoutTracing.

+ + +
+
+
+

Parameters:

+
    + +
  • + + set_transaction_name + + + (Boolean) + + + + — +

    If true, the GraphQL operation name will be used as the transaction name. +This is not advised if you run more than one query per HTTP request, for example, with graphql-client or multiplexing. +It can also be specified per-query with context[:set_scout_transaction_name].

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+22
+23
+24
+25
+26
+
+
# File 'lib/graphql/tracing/scout_tracing.rb', line 22
+
+def initialize(options = {})
+  self.class.include ScoutApm::Tracer
+  @set_transaction_name = options.fetch(:set_transaction_name, false)
+  super(options)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+45
+46
+47
+
+
# File 'lib/graphql/tracing/scout_tracing.rb', line 45
+
+def platform_authorized_key(type)
+  "#{type.graphql_name}.authorized"
+end
+
+
+ +
+

+ + #platform_field_key(type, field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'lib/graphql/tracing/scout_tracing.rb', line 41
+
+def platform_field_key(type, field)
+  "#{type.graphql_name}.#{field.graphql_name}"
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+49
+50
+51
+
+
# File 'lib/graphql/tracing/scout_tracing.rb', line 49
+
+def platform_resolve_type_key(type)
+  "#{type.graphql_name}.resolve_type"
+end
+
+
+ +
+

+ + #platform_trace(platform_key, key, data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+
+
# File 'lib/graphql/tracing/scout_tracing.rb', line 28
+
+def platform_trace(platform_key, key, data)
+  if key == "execute_query"
+    set_this_txn_name = data[:query].context[:set_scout_transaction_name]
+    if set_this_txn_name == true || (set_this_txn_name.nil? && @set_transaction_name)
+      ScoutApm::Transaction.rename(transaction_name(data[:query]))
+    end
+  end
+
+  self.class.instrument("GraphQL", platform_key, INSTRUMENT_OPTS) do
+    yield
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/StatsdTrace.html b/api-doc/2.1.6/GraphQL/Tracing/StatsdTrace.html new file mode 100644 index 0000000000..7791ef3aa9 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/StatsdTrace.html @@ -0,0 +1,493 @@ + + + + + + + Module: GraphQL::Tracing::StatsdTrace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::StatsdTrace + + + +

+
+ + + + + + +
+
Includes:
+
PlatformTrace
+
+ + + + + + +
+
Defined in:
+
lib/graphql/tracing/statsd_trace.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from PlatformTrace

+

#platform_authorized_lazy, #platform_execute_field_lazy, #platform_resolve_type_lazy

+ + +
+

Instance Method Details

+ + +
+

+ + #initialize(statsd:, **rest) ⇒ Object + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + statsd + + + (Object) + + + + — +

    A statsd client

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+9
+10
+11
+12
+
+
# File 'lib/graphql/tracing/statsd_trace.rb', line 9
+
+def initialize(statsd:, **rest)
+  @statsd = statsd
+  super(**rest)
+end
+
+
+ +
+

+ + #platform_authorized(key, &block) ⇒ Object + + + + Also known as: + platform_resolve_type + + + + +

+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'lib/graphql/tracing/statsd_trace.rb', line 37
+
+def platform_authorized(key, &block)
+  @statsd.time(key, &block)
+end
+
+
+ +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+47
+48
+49
+
+
# File 'lib/graphql/tracing/statsd_trace.rb', line 47
+
+def platform_authorized_key(type)
+  "graphql.authorized.#{type.graphql_name}"
+end
+
+
+ +
+

+ + #platform_execute_field(platform_key, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/tracing/statsd_trace.rb', line 33
+
+def platform_execute_field(platform_key, &block)
+  @statsd.time(platform_key, &block)
+end
+
+
+ +
+

+ + #platform_field_key(field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+43
+44
+45
+
+
# File 'lib/graphql/tracing/statsd_trace.rb', line 43
+
+def platform_field_key(field)
+  "graphql.#{field.path}"
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+51
+52
+53
+
+
# File 'lib/graphql/tracing/statsd_trace.rb', line 51
+
+def platform_resolve_type_key(type)
+  "graphql.resolve_type.#{type.graphql_name}"
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/StatsdTracing.html b/api-doc/2.1.6/GraphQL/Tracing/StatsdTracing.html new file mode 100644 index 0000000000..048634e710 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/StatsdTracing.html @@ -0,0 +1,457 @@ + + + + + + + Class: GraphQL::Tracing::StatsdTracing + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::StatsdTracing + + + +

+
+ +
+
Inherits:
+
+ PlatformTracing + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/statsd_tracing.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from PlatformTracing

+

#trace, use

+
+

Constructor Details

+ +
+

+ + #initialize(statsd:, **rest) ⇒ StatsdTracing + + + + + +

+
+

Returns a new instance of StatsdTracing.

+ + +
+
+
+

Parameters:

+
    + +
  • + + statsd + + + (Object) + + + + — +

    A statsd client

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+18
+19
+20
+21
+
+
# File 'lib/graphql/tracing/statsd_tracing.rb', line 18
+
+def initialize(statsd:, **rest)
+  @statsd = statsd
+  super(**rest)
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #platform_authorized_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+33
+34
+35
+
+
# File 'lib/graphql/tracing/statsd_tracing.rb', line 33
+
+def platform_authorized_key(type)
+  "graphql.authorized.#{type.graphql_name}"
+end
+
+
+ +
+

+ + #platform_field_key(type, field) ⇒ Object + + + + + +

+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/graphql/tracing/statsd_tracing.rb', line 29
+
+def platform_field_key(type, field)
+  "graphql.#{type.graphql_name}.#{field.graphql_name}"
+end
+
+
+ +
+

+ + #platform_resolve_type_key(type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+37
+38
+39
+
+
# File 'lib/graphql/tracing/statsd_tracing.rb', line 37
+
+def platform_resolve_type_key(type)
+  "graphql.resolve_type.#{type.graphql_name}"
+end
+
+
+ +
+

+ + #platform_trace(platform_key, key, data) ⇒ Object + + + + + +

+ + + + +
+
+
+
+23
+24
+25
+26
+27
+
+
# File 'lib/graphql/tracing/statsd_tracing.rb', line 23
+
+def platform_trace(platform_key, key, data)
+  @statsd.time(platform_key) do
+    yield
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/Trace.html b/api-doc/2.1.6/GraphQL/Tracing/Trace.html new file mode 100644 index 0000000000..e889385c3f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/Trace.html @@ -0,0 +1,999 @@ + + + + + + + Class: GraphQL::Tracing::Trace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Tracing::Trace + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/tracing/trace.rb
+
+ +
+ +

Overview

+
+

This is the base class for a trace instance whose methods are called during query execution. +“Trace modes” are subclasses of this with custom tracing modules mixed in.

+ +

A trace module may implement any of the methods on Trace, being sure to call super +to continue any tracing hooks and call the actual runtime behavior. See Backtrace::Trace for example.

+ + +
+
+
+ + +
+

Direct Known Subclasses

+

LegacyTrace

+
+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(multiplex: nil, query: nil, **_options) ⇒ Trace + + + + + +

+
+

Returns a new instance of Trace.

+ + +
+
+
+

Parameters:

+ + + +
+ + + + +
+
+
+
+13
+14
+15
+16
+
+
# File 'lib/graphql/tracing/trace.rb', line 13
+
+def initialize(multiplex: nil, query: nil, **_options)
+  @multiplex = multiplex
+  @query = query
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #analyze_multiplex(multiplex:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/graphql/tracing/trace.rb', line 30
+
+def analyze_multiplex(multiplex:)
+  yield
+end
+
+
+ +
+

+ + #analyze_query(query:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+34
+35
+36
+
+
# File 'lib/graphql/tracing/trace.rb', line 34
+
+def analyze_query(query:)
+  yield
+end
+
+
+ +
+

+ + #authorized(query:, type:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+58
+59
+60
+
+
# File 'lib/graphql/tracing/trace.rb', line 58
+
+def authorized(query:, type:, object:)
+  yield
+end
+
+
+ +
+

+ + #authorized_lazy(query:, type:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+62
+63
+64
+
+
# File 'lib/graphql/tracing/trace.rb', line 62
+
+def authorized_lazy(query:, type:, object:)
+  yield
+end
+
+
+ +
+

+ + #execute_field(field:, query:, ast_node:, arguments:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+50
+51
+52
+
+
# File 'lib/graphql/tracing/trace.rb', line 50
+
+def execute_field(field:, query:, ast_node:, arguments:, object:)
+  yield
+end
+
+
+ +
+

+ + #execute_field_lazy(field:, query:, ast_node:, arguments:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+54
+55
+56
+
+
# File 'lib/graphql/tracing/trace.rb', line 54
+
+def execute_field_lazy(field:, query:, ast_node:, arguments:, object:)
+  yield
+end
+
+
+ +
+

+ + #execute_multiplex(multiplex:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+38
+39
+40
+
+
# File 'lib/graphql/tracing/trace.rb', line 38
+
+def execute_multiplex(multiplex:)
+  yield
+end
+
+
+ +
+

+ + #execute_query(query:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+42
+43
+44
+
+
# File 'lib/graphql/tracing/trace.rb', line 42
+
+def execute_query(query:)
+  yield
+end
+
+
+ +
+

+ + #execute_query_lazy(query:, multiplex:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+46
+47
+48
+
+
# File 'lib/graphql/tracing/trace.rb', line 46
+
+def execute_query_lazy(query:, multiplex:)
+  yield
+end
+
+
+ +
+

+ + #lex(query_string:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/graphql/tracing/trace.rb', line 18
+
+def lex(query_string:)
+  yield
+end
+
+
+ +
+

+ + #parse(query_string:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/tracing/trace.rb', line 22
+
+def parse(query_string:)
+  yield
+end
+
+
+ +
+

+ + #resolve_type(query:, type:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+66
+67
+68
+
+
# File 'lib/graphql/tracing/trace.rb', line 66
+
+def resolve_type(query:, type:, object:)
+  yield
+end
+
+
+ +
+

+ + #resolve_type_lazy(query:, type:, object:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+70
+71
+72
+
+
# File 'lib/graphql/tracing/trace.rb', line 70
+
+def resolve_type_lazy(query:, type:, object:)
+  yield
+end
+
+
+ +
+

+ + #validate(query:, validate:) ⇒ Object + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/tracing/trace.rb', line 26
+
+def validate(query:, validate:)
+  yield
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Tracing/Traceable.html b/api-doc/2.1.6/GraphQL/Tracing/Traceable.html new file mode 100644 index 0000000000..9cb67ee90f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Tracing/Traceable.html @@ -0,0 +1,262 @@ + + + + + + + Module: GraphQL::Tracing::Traceable + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Tracing::Traceable + + + Private +

+
+ + + + + + + + + +
+
Included in:
+
Execution::Multiplex, Query
+
+ + + +
+
Defined in:
+
lib/graphql/tracing.rb
+
+ +
+ +

Overview

+
+

+ This module is part of a private API. + You should avoid using this module if possible, as it may be removed or be changed in the future. +

+

Objects may include traceable to gain a .trace(...) method. +The object must have a @tracers ivar of type Array<<#trace(k, d, &b)>>.

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #trace(key, metadata, &block) ⇒ Object + + + + + +

+
+

+ This method is part of a private API. + You should avoid using this method if possible, as it may be removed or be changed in the future. +

+

Returns Must return the value of the block.

+ + +
+
+
+

Parameters:

+
    + +
  • + + key + + + (String) + + + + — +

    The name of the event in GraphQL internals

    +
    + +
  • + +
  • + + metadata + + + (Hash) + + + + — +

    Event-related metadata (can be anything)

    +
    + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    Must return the value of the block

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+42
+43
+44
+45
+
+
# File 'lib/graphql/tracing.rb', line 42
+
+def trace(key, , &block)
+  return yield if @tracers.empty?
+  call_tracers(0, key, , &block)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/TypeKinds.html b/api-doc/2.1.6/GraphQL/TypeKinds.html new file mode 100644 index 0000000000..e2fcdf9256 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/TypeKinds.html @@ -0,0 +1,150 @@ + + + + + + + Module: GraphQL::TypeKinds + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::TypeKinds + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/type_kinds.rb
+
+ +
+ +

Overview

+
+

Type kinds are the basic categories which a type may belong to (Object, Scalar, Union…)

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + + + Classes: TypeKind + + +

+ + +

+ Constant Summary + collapse +

+ +
+ +
TYPE_KINDS = + +
+
[
+  SCALAR =        TypeKind.new("SCALAR", input: true, leaf: true, description: 'Indicates this type is a scalar.'),
+  OBJECT =        TypeKind.new("OBJECT", fields: true, description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.'),
+  INTERFACE =     TypeKind.new("INTERFACE", abstract: true, fields: true, description: 'Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.'),
+  UNION =         TypeKind.new("UNION", abstract: true, description: 'Indicates this type is a union. `possibleTypes` is a valid field.'),
+  ENUM =          TypeKind.new("ENUM", input: true, leaf: true, description: 'Indicates this type is an enum. `enumValues` is a valid field.'),
+  INPUT_OBJECT =  TypeKind.new("INPUT_OBJECT", input: true, description: 'Indicates this type is an input object. `inputFields` is a valid field.'),
+  LIST =          TypeKind.new("LIST", wraps: true, description: 'Indicates this type is a list. `ofType` is a valid field.'),
+  NON_NULL =      TypeKind.new("NON_NULL", wraps: true, description: 'Indicates this type is a non-null. `ofType` is a valid field.'),
+]
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/TypeKinds/TypeKind.html b/api-doc/2.1.6/GraphQL/TypeKinds/TypeKind.html new file mode 100644 index 0000000000..14ed9d76c5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/TypeKinds/TypeKind.html @@ -0,0 +1,1544 @@ + + + + + + + Class: GraphQL::TypeKinds::TypeKind + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::TypeKinds::TypeKind + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/type_kinds.rb
+
+ +
+ +

Overview

+
+

These objects are singletons, eg GraphQL::TypeKinds::UNION, GraphQL::TypeKinds::SCALAR.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #description ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute description.

    +
    + +
  • + + +
  • + + + #name ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    Returns the value of attribute name.

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(name, abstract: false, leaf: false, fields: false, wraps: false, input: false, description: nil) ⇒ TypeKind + + + + + +

+
+

Returns a new instance of TypeKind.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
+
# File 'lib/graphql/type_kinds.rb', line 8
+
+def initialize(name, abstract: false, leaf: false, fields: false, wraps: false, input: false, description: nil)
+  @name = name
+  @abstract = abstract
+  @fields = fields
+  @wraps = wraps
+  @input = input
+  @leaf = leaf
+  @composite = fields? || abstract?
+  @description = description
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #descriptionObject (readonly) + + + + + +

+
+

Returns the value of attribute description.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/type_kinds.rb', line 7
+
+def description
+  @description
+end
+
+
+ + + +
+

+ + #nameObject (readonly) + + + + + +

+
+

Returns the value of attribute name.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/type_kinds.rb', line 7
+
+def name
+  @name
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #abstract?Boolean + + + + + +

+
+

Is this TypeKind abstract?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+23
+
+
# File 'lib/graphql/type_kinds.rb', line 23
+
+def abstract?; @abstract; end
+
+
+ +
+

+ + #composite?Boolean + + + + + +

+
+

Is this TypeKind composed of many values?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+34
+
+
# File 'lib/graphql/type_kinds.rb', line 34
+
+def composite?; @composite; end
+
+
+ +
+

+ + #enum?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+52
+53
+54
+
+
# File 'lib/graphql/type_kinds.rb', line 52
+
+def enum?
+  self == TypeKinds::ENUM
+end
+
+
+ +
+

+ + #fields?Boolean + + + + + +

+
+

Does this TypeKind have queryable fields?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+25
+
+
# File 'lib/graphql/type_kinds.rb', line 25
+
+def fields?;    @fields;    end
+
+
+ +
+

+ + #input?Boolean + + + + + +

+
+

Is this TypeKind a valid query input?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+29
+
+
# File 'lib/graphql/type_kinds.rb', line 29
+
+def input?;     @input;     end
+
+
+ +
+

+ + #input_object?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+56
+57
+58
+
+
# File 'lib/graphql/type_kinds.rb', line 56
+
+def input_object?
+  self == TypeKinds::INPUT_OBJECT
+end
+
+
+ +
+

+ + #interface?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'lib/graphql/type_kinds.rb', line 44
+
+def interface?
+  self == TypeKinds::INTERFACE
+end
+
+
+ +
+

+ + #leaf?Boolean + + + + + +

+
+

Is this TypeKind a primitive value?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+32
+
+
# File 'lib/graphql/type_kinds.rb', line 32
+
+def leaf?; @leaf; end
+
+
+ +
+

+ + #list?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+60
+61
+62
+
+
# File 'lib/graphql/type_kinds.rb', line 60
+
+def list?
+  self == TypeKinds::LIST
+end
+
+
+ +
+

+ + #non_null?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+64
+65
+66
+
+
# File 'lib/graphql/type_kinds.rb', line 64
+
+def non_null?
+  self == TypeKinds::NON_NULL
+end
+
+
+ +
+

+ + #object?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+40
+41
+42
+
+
# File 'lib/graphql/type_kinds.rb', line 40
+
+def object?
+  self == TypeKinds::OBJECT
+end
+
+
+ +
+

+ + #resolves?Boolean + + + + + +

+
+
Deprecated.

Use abstract? instead of resolves?.

+
+

Does this TypeKind have multiple possible implementors?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+21
+
+
# File 'lib/graphql/type_kinds.rb', line 21
+
+def resolves?;  @abstract;  end
+
+
+ +
+

+ + #scalar?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/type_kinds.rb', line 36
+
+def scalar?
+  self == TypeKinds::SCALAR
+end
+
+
+ +
+

+ + #to_sObject + + + + + +

+ + + + +
+
+
+
+30
+
+
# File 'lib/graphql/type_kinds.rb', line 30
+
+def to_s;       @name;      end
+
+
+ +
+

+ + #union?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+48
+49
+50
+
+
# File 'lib/graphql/type_kinds.rb', line 48
+
+def union?
+  self == TypeKinds::UNION
+end
+
+
+ +
+

+ + #wraps?Boolean + + + + + +

+
+

Does this TypeKind modify another type?

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+27
+
+
# File 'lib/graphql/type_kinds.rb', line 27
+
+def wraps?;     @wraps;     end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types.html b/api-doc/2.1.6/GraphQL/Types.html new file mode 100644 index 0000000000..581375fb56 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types.html @@ -0,0 +1,119 @@ + + + + + + + Module: GraphQL::Types + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/id.rb,
+ lib/graphql/types/int.rb,
lib/graphql/types/json.rb,
lib/graphql/types/float.rb,
lib/graphql/types/relay.rb,
lib/graphql/types/string.rb,
lib/graphql/types/big_int.rb,
lib/graphql/types/boolean.rb,
lib/graphql/types/relay/node.rb,
lib/graphql/types/iso_8601_date.rb,
lib/graphql/types/relay/base_edge.rb,
lib/graphql/types/relay/page_info.rb,
lib/graphql/types/iso_8601_duration.rb,
lib/graphql/types/iso_8601_date_time.rb,
lib/graphql/types/relay/edge_behaviors.rb,
lib/graphql/types/relay/has_node_field.rb,
lib/graphql/types/relay/node_behaviors.rb,
lib/graphql/types/relay/base_connection.rb,
lib/graphql/types/relay/has_nodes_field.rb,
lib/graphql/types/relay/page_info_behaviors.rb,
lib/graphql/types/relay/connection_behaviors.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: Relay + + + + Classes: BigInt, Boolean, Float, ID, ISO8601Date, ISO8601DateTime, ISO8601Duration, Int, JSON, String + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/BigInt.html b/api-doc/2.1.6/GraphQL/Types/BigInt.html new file mode 100644 index 0000000000..54a0e85215 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/BigInt.html @@ -0,0 +1,449 @@ + + + + + + + Class: GraphQL::Types::BigInt + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::BigInt + + + +

+
+ +
+
Inherits:
+
+ Schema::Scalar + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/big_int.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Scalar

+

default_scalar, default_scalar?, kind, specified_by_url, validate_non_null_input

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(value, _ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+11
+12
+
+
# File 'lib/graphql/types/big_int.rb', line 8
+
+def self.coerce_input(value, _ctx)
+  value && parse_int(value)
+rescue ArgumentError
+  nil
+end
+
+
+ +
+

+ + .coerce_result(value, _ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+14
+15
+16
+
+
# File 'lib/graphql/types/big_int.rb', line 14
+
+def self.coerce_result(value, _ctx)
+  value.to_i.to_s
+end
+
+
+ +
+

+ + .parse_int(value) ⇒ Object + + + + + +

+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/graphql/types/big_int.rb', line 18
+
+def self.parse_int(value)
+  value.is_a?(Numeric) ? value : Integer(value, 10)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Boolean.html b/api-doc/2.1.6/GraphQL/Types/Boolean.html new file mode 100644 index 0000000000..6f303b23f5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Boolean.html @@ -0,0 +1,392 @@ + + + + + + + Class: GraphQL::Types::Boolean + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::Boolean + + + +

+
+ +
+
Inherits:
+
+ Schema::Scalar + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/boolean.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Scalar

+

default_scalar, default_scalar?, kind, specified_by_url, validate_non_null_input

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(value, _ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/types/boolean.rb', line 7
+
+def self.coerce_input(value, _ctx)
+  (value == true || value == false) ? value : nil
+end
+
+
+ +
+

+ + .coerce_result(value, _ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+11
+12
+13
+
+
# File 'lib/graphql/types/boolean.rb', line 11
+
+def self.coerce_result(value, _ctx)
+  !!value
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Float.html b/api-doc/2.1.6/GraphQL/Types/Float.html new file mode 100644 index 0000000000..9f9b2aae26 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Float.html @@ -0,0 +1,392 @@ + + + + + + + Class: GraphQL::Types::Float + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::Float + + + +

+
+ +
+
Inherits:
+
+ Schema::Scalar + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/float.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Scalar

+

default_scalar, default_scalar?, kind, specified_by_url, validate_non_null_input

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(value, _ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/types/float.rb', line 8
+
+def self.coerce_input(value, _ctx)
+  value.is_a?(Numeric) ? value.to_f : nil
+end
+
+
+ +
+

+ + .coerce_result(value, _ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/types/float.rb', line 12
+
+def self.coerce_result(value, _ctx)
+  value.to_f
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/ID.html b/api-doc/2.1.6/GraphQL/Types/ID.html new file mode 100644 index 0000000000..4c8ed64a9d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/ID.html @@ -0,0 +1,406 @@ + + + + + + + Class: GraphQL::Types::ID + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::ID + + + +

+
+ +
+
Inherits:
+
+ Schema::Scalar + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/id.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Scalar

+

default_scalar, default_scalar?, kind, specified_by_url, validate_non_null_input

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(value, _ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/types/id.rb', line 12
+
+def self.coerce_input(value, _ctx)
+  case value
+  when ::String
+    value
+  when Integer
+    value.to_s
+  else
+    nil
+  end
+end
+
+
+ +
+

+ + .coerce_result(value, _ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+
+
# File 'lib/graphql/types/id.rb', line 8
+
+def self.coerce_result(value, _ctx)
+  value.is_a?(::String) ? value : value.to_s
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/ISO8601Date.html b/api-doc/2.1.6/GraphQL/Types/ISO8601Date.html new file mode 100644 index 0000000000..e4db4398a5 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/ISO8601Date.html @@ -0,0 +1,515 @@ + + + + + + + Class: GraphQL::Types::ISO8601Date + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::ISO8601Date + + + +

+
+ +
+
Inherits:
+
+ Schema::Scalar + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/iso_8601_date.rb
+
+ +
+ +

Overview

+
+

This scalar takes Dates and transmits them as strings, +using ISO 8601 format.

+ +

Use it for fields or arguments as follows:

+ +
field :published_at, GraphQL::Types::ISO8601Date, null: false
+
+argument :deliver_at, GraphQL::Types::ISO8601Date, null: false
+
+ +

Alternatively, use this built-in scalar as inspiration for your +own Date type.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Scalar

+

default_scalar, default_scalar?, kind, specified_by_url, validate_non_null_input

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(value, ctx) ⇒ Date? + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + str_value + + + (String, Date, DateTime, Time) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Date, nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+
+
# File 'lib/graphql/types/iso_8601_date.rb', line 27
+
+def self.coerce_input(value, ctx)
+  if value.is_a?(::Date)
+    value
+  elsif value.is_a?(::DateTime)
+    value.to_date
+  elsif value.is_a?(::Time)
+    value.to_date
+  elsif value.nil?
+    nil
+  else
+    Date.iso8601(value)
+  end
+rescue ArgumentError, TypeError
+  err = GraphQL::DateEncodingError.new(value)
+  ctx.schema.type_error(err, ctx)
+end
+
+
+ +
+

+ + .coerce_result(value, _ctx) ⇒ String + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Date, Time, DateTime, String) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+21
+22
+23
+
+
# File 'lib/graphql/types/iso_8601_date.rb', line 21
+
+def self.coerce_result(value, _ctx)
+  Date.parse(value.to_s).iso8601
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/ISO8601DateTime.html b/api-doc/2.1.6/GraphQL/Types/ISO8601DateTime.html new file mode 100644 index 0000000000..047125cfc1 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/ISO8601DateTime.html @@ -0,0 +1,724 @@ + + + + + + + Class: GraphQL::Types::ISO8601DateTime + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::ISO8601DateTime + + + +

+
+ +
+
Inherits:
+
+ Schema::Scalar + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/iso_8601_date_time.rb
+
+ +
+ +

Overview

+
+

This scalar takes Times and transmits them as strings, +using ISO 8601 format.

+ +

Use it for fields or arguments as follows:

+ +
field :created_at, GraphQL::Types::ISO8601DateTime, null: false
+
+argument :deliver_at, GraphQL::Types::ISO8601DateTime, null: false
+
+ +

Alternatively, use this built-in scalar as inspiration for your +own DateTime type.

+ + +
+
+
+ + +
+ +

+ Constant Summary + collapse +

+ +
+ +
DEFAULT_TIME_PRECISION = +
+
+

It’s not compatible with Rails’ default, +i.e. ActiveSupport::JSON::Encoder.time_precision (3 by default)

+ + +
+
+
+ + +
+
+
0
+ +
+ + + + + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Scalar

+

default_scalar, default_scalar?, kind, specified_by_url, validate_non_null_input

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(str_value, _ctx) ⇒ Time + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + str_value + + + (String) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (Time) + + + +
  • + +
+ +
+ + + + +
+
+
+
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+
+
# File 'lib/graphql/types/iso_8601_date_time.rb', line 54
+
+def self.coerce_input(str_value, _ctx)
+  Time.iso8601(str_value)
+rescue ArgumentError, TypeError
+  begin
+    dt = Date.iso8601(str_value).to_time
+    # For compatibility, continue accepting dates given without times
+    # But without this, it would zero out given any time part of `str_value` (hours and/or minutes)
+    if dt.iso8601.start_with?(str_value)
+      dt
+    elsif str_value.length == 8 && str_value.match?(/\A\d{8}\Z/)
+      # Allow dates that are missing the "-". eg. "20220404"
+      dt
+    else
+      nil
+    end
+  rescue ArgumentError, TypeError
+    # Invalid input
+    nil
+  end
+end
+
+
+ +
+

+ + .coerce_result(value, _ctx) ⇒ String + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Time, Date, DateTime, String) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+ +
+ + + + +
+
+
+
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
+
# File 'lib/graphql/types/iso_8601_date_time.rb', line 38
+
+def self.coerce_result(value, _ctx)
+  case value
+  when Date
+    return value.to_time.iso8601(time_precision)
+  when ::String
+    return Time.parse(value).iso8601(time_precision)
+  else
+    # Time, DateTime or compatible is given:
+    return value.iso8601(time_precision)
+  end
+rescue StandardError => error
+  raise GraphQL::Error, "An incompatible object (#{value.class}) was given to #{self}. Make sure that only Times, Dates, DateTimes, and well-formatted Strings are used with this type. (#{error.message})"
+end
+
+
+ +
+

+ + .time_precisionInteger + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer) + + + +
  • + +
+ +
+ + + + +
+
+
+
+27
+28
+29
+
+
# File 'lib/graphql/types/iso_8601_date_time.rb', line 27
+
+def self.time_precision
+  @time_precision || DEFAULT_TIME_PRECISION
+end
+
+
+ +
+

+ + .time_precision=(value) ⇒ Object + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Integer) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+32
+33
+34
+
+
# File 'lib/graphql/types/iso_8601_date_time.rb', line 32
+
+def self.time_precision=(value)
+  @time_precision = value
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/ISO8601Duration.html b/api-doc/2.1.6/GraphQL/Types/ISO8601Duration.html new file mode 100644 index 0000000000..3643696f23 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/ISO8601Duration.html @@ -0,0 +1,755 @@ + + + + + + + Class: GraphQL::Types::ISO8601Duration + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::ISO8601Duration + + + +

+
+ +
+
Inherits:
+
+ Schema::Scalar + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/iso_8601_duration.rb
+
+ +
+ +

Overview

+
+

This scalar takes Durations and transmits them as strings, +using ISO 8601 format. ActiveSupport >= 5.0 must be loaded to use +this scalar.

+ +

Use it for fields or arguments as follows:

+ +
field :age, GraphQL::Types::ISO8601Duration, null: false
+
+argument :interval, GraphQL::Types::ISO8601Duration, null: false
+
+ +

Alternatively, use this built-in scalar as inspiration for your +own Duration type.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Scalar

+

default_scalar, default_scalar?, kind, specified_by_url, validate_non_null_input

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(value, ctx) ⇒ ActiveSupport::Duration? + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (String, ActiveSupport::Duration) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (ActiveSupport::Duration, nil) + + + +
  • + +
+

Raises:

+ + +
+ + + + +
+
+
+
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
+
# File 'lib/graphql/types/iso_8601_duration.rb', line 57
+
+def self.coerce_input(value, ctx)
+  unless defined?(ActiveSupport::Duration)
+    raise GraphQL::Error, "ActiveSupport >= 5.0 must be loaded to use the built-in ISO8601Duration type."
+  end
+
+  begin
+    if value.is_a?(ActiveSupport::Duration)
+      value
+    elsif value.nil?
+      nil
+    else
+      ActiveSupport::Duration.parse(value)
+    end
+  rescue ArgumentError, TypeError
+    err = GraphQL::DurationEncodingError.new(value)
+    ctx.schema.type_error(err, ctx)
+  end
+end
+
+
+ +
+

+ + .coerce_result(value, _ctx) ⇒ String + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (ActiveSupport::Duration, String) + + + +
  • + +
+ +

Returns:

+
    + +
  • + + + (String) + + + +
  • + +
+

Raises:

+
    + +
  • + + + (GraphQL::Error) + + + + — +

    if ActiveSupport::Duration is not defined or if an incompatible object is passed

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
+
# File 'lib/graphql/types/iso_8601_duration.rb', line 33
+
+def self.coerce_result(value, _ctx)
+  unless defined?(ActiveSupport::Duration)
+    raise GraphQL::Error, "ActiveSupport >= 5.0 must be loaded to use the built-in ISO8601Duration type."
+  end
+
+  begin
+    case value
+    when ActiveSupport::Duration
+      value.iso8601(precision: seconds_precision)
+    when ::String
+      ActiveSupport::Duration.parse(value).iso8601(precision: seconds_precision)
+    else
+      # Try calling as ActiveSupport::Duration compatible as a fallback
+      value.iso8601(precision: seconds_precision)
+    end
+  rescue StandardError => error
+    raise GraphQL::Error, "An incompatible object (#{value.class}) was given to #{self}. Make sure that only ActiveSupport::Durations and well-formatted Strings are used with this type. (#{error.message})"
+  end
+end
+
+
+ +
+

+ + .seconds_precisionInteger? + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Integer, nil) + + + +
  • + +
+ +
+ + + + +
+
+
+
+20
+21
+22
+23
+
+
# File 'lib/graphql/types/iso_8601_duration.rb', line 20
+
+def self.seconds_precision
+  # ActiveSupport::Duration precision defaults to whatever input was given
+  @seconds_precision
+end
+
+
+ +
+

+ + .seconds_precision=(value) ⇒ Object + + + + + +

+
+ + + +
+
+
+

Parameters:

+
    + +
  • + + value + + + (Integer, nil) + + + +
  • + +
+ + +
+ + + + +
+
+
+
+26
+27
+28
+
+
# File 'lib/graphql/types/iso_8601_duration.rb', line 26
+
+def self.seconds_precision=(value)
+  @seconds_precision = value
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Int.html b/api-doc/2.1.6/GraphQL/Types/Int.html new file mode 100644 index 0000000000..c0c7bdb981 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Int.html @@ -0,0 +1,456 @@ + + + + + + + Class: GraphQL::Types::Int + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::Int + + + +

+
+ +
+
Inherits:
+
+ Schema::Scalar + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/int.rb
+
+ +
+ +

Overview

+
+ + + +
+
+
+ + +

See Also:

+
    + +
  • for handling integers outside 32-bit range.
  • + +
+ +
+ +

+ Constant Summary + collapse +

+ +
+ +
MIN = + +
+
-(2**31)
+ +
MAX = + +
+
(2**31) - 1
+ +
+ + + + + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Scalar

+

default_scalar, default_scalar?, kind, specified_by_url, validate_non_null_input

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(value, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/types/int.rb', line 12
+
+def self.coerce_input(value, ctx)
+  return if !value.is_a?(Integer)
+
+  if value >= MIN && value <= MAX
+    value
+  else
+    err = GraphQL::IntegerDecodingError.new(value)
+    ctx.schema.type_error(err, ctx)
+  end
+end
+
+
+ +
+

+ + .coerce_result(value, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
+
# File 'lib/graphql/types/int.rb', line 23
+
+def self.coerce_result(value, ctx)
+  value = value.to_i
+  if value >= MIN && value <= MAX
+    value
+  else
+    err = GraphQL::IntegerEncodingError.new(value, context: ctx)
+    ctx.schema.type_error(err, ctx)
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/JSON.html b/api-doc/2.1.6/GraphQL/Types/JSON.html new file mode 100644 index 0000000000..c32cb41c9e --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/JSON.html @@ -0,0 +1,410 @@ + + + + + + + Class: GraphQL::Types::JSON + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::JSON + + + +

+
+ +
+
Inherits:
+
+ Schema::Scalar + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/json.rb
+
+ +
+ +

Overview

+
+

An untyped JSON scalar that maps to Ruby hashes, arrays, strings, integers, floats, booleans and nils. +This should be used judiciously because it subverts the GraphQL type system.

+ +

Use it for fields or arguments as follows:

+ +
field :template_parameters, GraphQL::Types::JSON, null: false
+
+argument :template_parameters, GraphQL::Types::JSON, null: false
+
+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Scalar

+

default_scalar, default_scalar?, kind, specified_by_url, validate_non_null_input

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(value, _context) ⇒ Object + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/types/json.rb', line 16
+
+def self.coerce_input(value, _context)
+  value
+end
+
+
+ +
+

+ + .coerce_result(value, _context) ⇒ Object + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/graphql/types/json.rb', line 20
+
+def self.coerce_result(value, _context)
+  value
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay.html b/api-doc/2.1.6/GraphQL/Types/Relay.html new file mode 100644 index 0000000000..72f38f9460 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay.html @@ -0,0 +1,146 @@ + + + + + + + Module: GraphQL::Types::Relay + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/relay.rb,
+ lib/graphql/types/relay/node.rb,
lib/graphql/types/relay/base_edge.rb,
lib/graphql/types/relay/page_info.rb,
lib/graphql/types/relay/edge_behaviors.rb,
lib/graphql/types/relay/has_node_field.rb,
lib/graphql/types/relay/node_behaviors.rb,
lib/graphql/types/relay/base_connection.rb,
lib/graphql/types/relay/has_nodes_field.rb,
lib/graphql/types/relay/page_info_behaviors.rb,
lib/graphql/types/relay/connection_behaviors.rb
+
+
+ +
+ +

Overview

+
+

This module contains some types and fields that could support Relay conventions in GraphQL.

+ +

You can use these classes out of the box if you want, but if you want to use your own +GraphQL extensions along with the features in this code, you could also +open up the source files and copy the relevant methods and configuration into +your own classes.

+ +

For example, the provided object types extend Types::Relay::BaseObject, +but you might want to:

+ +
    +
  1. Migrate the extensions from Types::Relay::BaseObject into your app’s base object
  2. +
  3. Copy BaseConnection, BaseEdge, etc into your app, and + change them to extend your base object.
  4. +
+ +

Similarly, BaseField’s extensions could be migrated to your app +and Node could be implemented to mix in your base interface module.

+ + +
+
+
+ + +

Defined Under Namespace

+

+ + + Modules: ClassMethods, ConnectionBehaviors, EdgeBehaviors, HasNodeField, HasNodesField, Node, NodeBehaviors, PageInfoBehaviors + + + + Classes: BaseConnection, BaseEdge, PageInfo + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/BaseConnection.html b/api-doc/2.1.6/GraphQL/Types/Relay/BaseConnection.html new file mode 100644 index 0000000000..a448c79c1f --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/BaseConnection.html @@ -0,0 +1,374 @@ + + + + + + + Class: GraphQL::Types::Relay::BaseConnection + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::Relay::BaseConnection + + + +

+
+ +
+
Inherits:
+
+ Schema::Object + + + show all + +
+
+ + + + + + +
+
Includes:
+
ConnectionBehaviors
+
+ + + + + + +
+
Defined in:
+
lib/graphql/types/relay/base_connection.rb
+
+ +
+ +

Overview

+
+

Use this to implement Relay connections, or take it as inspiration +for Relay classes in your own app.

+ +

You may wish to copy this code into your own base class, +so you can extend your own BaseObject instead of GraphQL::Schema::Object.

+ + +
+
+
+ +
+

Examples:

+ + +

Implementation a connection and edge

+

+ +
class BaseObject < GraphQL::Schema::Object; end
+
+# Given some object in your app ...
+class Types::Post < BaseObject
+end
+
+# Make a couple of base classes:
+class Types::BaseEdge < GraphQL::Types::Relay::BaseEdge; end
+class Types::BaseConnection < GraphQL::Types::Relay::BaseConnection; end
+
+# Then extend them for the object in your app
+class Types::PostEdge < Types::BaseEdge
+  node_type Types::Post
+end
+
+class Types::PostConnection < Types::BaseConnection
+  edge_type Types::PostEdge,
+            edges_nullable: true,
+            edge_nullable: true,
+            node_nullable: true,
+            nodes_field: true
+
+  # Alternatively, you can call the class methods followed by your edge type
+  # edges_nullable true
+  # edge_nullable true
+  # node_nullable true
+  # has_nodes_field true
+  # edge_type Types::PostEdge
+end
+ +
+ + +

See Also:

+ + +
+ + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + + + + + + + +

Method Summary

+ +

Methods included from ConnectionBehaviors

+

add_page_info_field, #edges, #nodes

+ + + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/BaseEdge.html b/api-doc/2.1.6/GraphQL/Types/Relay/BaseEdge.html new file mode 100644 index 0000000000..6aa390ec99 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/BaseEdge.html @@ -0,0 +1,354 @@ + + + + + + + Class: GraphQL::Types::Relay::BaseEdge + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::Relay::BaseEdge + + + +

+
+ +
+
Inherits:
+
+ Schema::Object + + + show all + +
+
+ + + + + + +
+
Includes:
+
EdgeBehaviors
+
+ + + + + + +
+
Defined in:
+
lib/graphql/types/relay/base_edge.rb
+
+ +
+ +

Overview

+
+

A class-based definition for Relay edges.

+ +

Use this as a parent class in your app, or use it as inspiration for your +own base Edge class.

+ +

For example, you may want to extend your own BaseObject instead of the +built-in GraphQL::Schema::Object.

+ + +
+
+
+ +
+

Examples:

+ + +

Making a UserEdge type

+

+ +
# Make a base class for your app
+class Types::BaseEdge < GraphQL::Types::Relay::BaseEdge
+end
+
+# Then extend your own base class
+class Types::UserEdge < Types::BaseEdge
+  node_type(Types::User)
+end
+ +
+ + +

See Also:

+
    + +
  • for connection types
  • + +
+ +
+ + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + + + + + + + +

Method Summary

+ +

Methods included from EdgeBehaviors

+

#node

+ + + + + + + + + +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/ClassMethods.html b/api-doc/2.1.6/GraphQL/Types/Relay/ClassMethods.html new file mode 100644 index 0000000000..b58bbca4df --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/ClassMethods.html @@ -0,0 +1,198 @@ + + + + + + + Module: GraphQL::Types::Relay::ClassMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::ClassMethods + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/relay/page_info_behaviors.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #default_relay?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+24
+25
+26
+
+
# File 'lib/graphql/types/relay/page_info_behaviors.rb', line 24
+
+def default_relay?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/ConnectionBehaviors.html b/api-doc/2.1.6/GraphQL/Types/Relay/ConnectionBehaviors.html new file mode 100644 index 0000000000..c2c8a8db7b --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/ConnectionBehaviors.html @@ -0,0 +1,337 @@ + + + + + + + Module: GraphQL::Types::Relay::ConnectionBehaviors + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::ConnectionBehaviors + + + +

+
+ + + + +
+
Extended by:
+
Forwardable
+
+ + + + + + +
+
Included in:
+
BaseConnection
+
+ + + +
+
Defined in:
+
lib/graphql/types/relay/connection_behaviors.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: ClassMethods + + + + +

+ + + + + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + +
+

Class Method Details

+ + +
+

+ + .add_page_info_field(obj_type) ⇒ Object + + + + + +

+ + + + +
+
+
+
+168
+169
+170
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 168
+
+def add_page_info_field(obj_type)
+  obj_type.field :page_info, GraphQL::Types::Relay::PageInfo, null: false, description: "Information to aid in pagination."
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #edgesObject + + + + + +

+ + + + +
+
+
+
+173
+174
+175
+176
+177
+178
+179
+180
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 173
+
+def edges
+  # Assume that whatever authorization needed to happen
+  # already happened at the connection level.
+  current_runtime_state = Thread.current[:__graphql_runtime_info]
+  query_runtime_state = current_runtime_state[context.query]
+  query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items?
+  @object.edges
+end
+
+
+ +
+

+ + #nodesObject + + + + + +

+ + + + +
+
+
+
+182
+183
+184
+185
+186
+187
+188
+189
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 182
+
+def nodes
+  # Assume that whatever authorization needed to happen
+  # already happened at the connection level.
+  current_runtime_state = Thread.current[:__graphql_runtime_info]
+  query_runtime_state = current_runtime_state[context.query]
+  query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items?
+  @object.nodes
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/ConnectionBehaviors/ClassMethods.html b/api-doc/2.1.6/GraphQL/Types/Relay/ConnectionBehaviors/ClassMethods.html new file mode 100644 index 0000000000..adca9f8e6c --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/ConnectionBehaviors/ClassMethods.html @@ -0,0 +1,1157 @@ + + + + + + + Module: GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/relay/connection_behaviors.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #edge_classClass + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + +
  • + +
+ +
+ + + + +
+
+
+
+44
+45
+46
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 44
+
+def edge_class
+  @edge_class
+end
+
+
+ + + +
+

+ + #edge_type(edge_type_class, edge_class: GraphQL::Pagination::Connection::Edge, node_type: edge_type_class.node_type, nodes_field: self.has_nodes_field, node_nullable: self.node_nullable, edges_nullable: self.edges_nullable, edge_nullable: self.edge_nullable, field_options: nil) ⇒ Object + + + + + +

+
+

Configure this connection to return edges and nodes based on edge_type_class.

+ +

This method will use the inputs to create: +- edges field +- nodes field +- description

+ +

It’s called when you subclass this base connection, trying to use the +class name to set defaults. You can call it again in the class definition +to override the default (or provide a value, if the default lookup failed).

+ + +
+
+
+

Parameters:

+
    + +
  • + + field_options + + + (Hash) + + + (defaults to: nil) + + + — +

    Any extra keyword arguments to pass to the field :edges, ... and field :nodes, ... configurations

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 57
+
+def edge_type(edge_type_class, edge_class: GraphQL::Pagination::Connection::Edge, node_type: edge_type_class.node_type, nodes_field: self.has_nodes_field, node_nullable: self.node_nullable, edges_nullable: self.edges_nullable, edge_nullable: self.edge_nullable, field_options: nil)
+  # Set this connection's graphql name
+  node_type_name = node_type.graphql_name
+
+  @node_type = node_type
+  @edge_type = edge_type_class
+  @edge_class = edge_class
+
+  base_field_options = {
+    name: :edges,
+    type: [edge_type_class, null: edge_nullable],
+    null: edges_nullable,
+    description: "A list of edges.",
+    scope: false, # Assume that the connection was already scoped.
+    connection: false,
+  }
+
+  if field_options
+    base_field_options.merge!(field_options)
+  end
+
+  field(**base_field_options)
+
+  define_nodes_field(node_nullable, field_options: field_options) if nodes_field
+
+  description("The connection type for #{node_type_name}.")
+end
+
+
+ + + +
+

+ + #node_typeClass + + + + + +

+
+ + + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + +
  • + +
+ +
+ + + + +
+
+
+
+41
+42
+43
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 41
+
+def node_type
+  @node_type
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #authorized?(obj, ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+95
+96
+97
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 95
+
+def authorized?(obj, ctx)
+  true # Let nodes be filtered out
+end
+
+
+ +
+

+ + #default_relay?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+36
+37
+38
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 36
+
+def default_relay?
+  true
+end
+
+
+ +
+

+ + #edge_nullable(new_value = nil) ⇒ Object + + + + + +

+
+

Set the default edge_nullable for this class and its child classes. (Defaults to true.) +Use edge_nullable(false) in your base class to make non-null edge fields.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+126
+127
+128
+129
+130
+131
+132
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 126
+
+def edge_nullable(new_value = nil)
+  if new_value.nil?
+    defined?(@edge_nullable) ? @edge_nullable : superclass.edge_nullable
+  else
+    @edge_nullable = new_value
+  end
+end
+
+
+ +
+

+ + #edges_nullable(new_value = nil) ⇒ Object + + + + + +

+
+

Set the default edges_nullable for this class and its child classes. (Defaults to true.) +Use edges_nullable(false) in your base class to make non-null edges fields.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+116
+117
+118
+119
+120
+121
+122
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 116
+
+def edges_nullable(new_value = nil)
+  if new_value.nil?
+    defined?(@edges_nullable) ? @edges_nullable : superclass.edges_nullable
+  else
+    @edges_nullable = new_value
+  end
+end
+
+
+ +
+

+ + #has_nodes_field(new_value = nil) ⇒ Object + + + + + +

+
+

Set the default nodes_field for this class and its child classes. (Defaults to true.) +Use nodes_field(false) in your base class to prevent adding of a nodes field.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+136
+137
+138
+139
+140
+141
+142
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 136
+
+def has_nodes_field(new_value = nil)
+  if new_value.nil?
+    defined?(@nodes_field) ? @nodes_field : superclass.has_nodes_field
+  else
+    @nodes_field = new_value
+  end
+end
+
+
+ +
+

+ + #inherited(child_class) ⇒ Object + + + + + +

+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 25
+
+def inherited(child_class)
+  super
+  child_class.has_nodes_field(has_nodes_field)
+  child_class.node_nullable(node_nullable)
+  child_class.edges_nullable(edges_nullable)
+  child_class.edge_nullable(edge_nullable)
+  child_class.edge_type = nil
+  child_class.node_type = nil
+  child_class.edge_class = nil
+end
+
+
+ +
+

+ + #node_nullable(new_value = nil) ⇒ Object + + + + + +

+
+

Set the default node_nullable for this class and its child classes. (Defaults to true.) +Use node_nullable(false) in your base class to make non-null node and nodes fields.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+106
+107
+108
+109
+110
+111
+112
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 106
+
+def node_nullable(new_value = nil)
+  if new_value.nil?
+    defined?(@node_nullable) ? @node_nullable : superclass.node_nullable
+  else
+    @node_nullable = new_value
+  end
+end
+
+
+ +
+

+ + #nodes_field(node_nullable: self.node_nullable, field_options: nil) ⇒ Object + + + + + +

+
+

Add the shortcut nodes field to this connection and its subclasses

+ + +
+
+
+ + +
+ + + + +
+
+
+
+91
+92
+93
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 91
+
+def nodes_field(node_nullable: self.node_nullable, field_options: nil)
+  define_nodes_field(node_nullable, field_options: field_options)
+end
+
+
+ +
+

+ + #scope_items(items, context) ⇒ Object + + + + + +

+
+

Filter this list according to the way its node type would scope them

+ + +
+
+
+ + +
+ + + + +
+
+
+
+86
+87
+88
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 86
+
+def scope_items(items, context)
+  node_type.scope_items(items, context)
+end
+
+
+ +
+

+ + #visible?(ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+99
+100
+101
+102
+
+
# File 'lib/graphql/types/relay/connection_behaviors.rb', line 99
+
+def visible?(ctx)
+  # if this is an abstract base class, there may be no `node_type`
+  node_type ? node_type.visible?(ctx) : super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/EdgeBehaviors.html b/api-doc/2.1.6/GraphQL/Types/Relay/EdgeBehaviors.html new file mode 100644 index 0000000000..3eb15087ba --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/EdgeBehaviors.html @@ -0,0 +1,196 @@ + + + + + + + Module: GraphQL::Types::Relay::EdgeBehaviors + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::EdgeBehaviors + + + +

+
+ + + + + + + + + +
+
Included in:
+
BaseEdge
+
+ + + +
+
Defined in:
+
lib/graphql/types/relay/edge_behaviors.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: ClassMethods + + + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #nodeObject + + + + + +

+ + + + +
+
+
+
+15
+16
+17
+18
+19
+20
+
+
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 15
+
+def node
+  current_runtime_state = Thread.current[:__graphql_runtime_info]
+  query_runtime_state = current_runtime_state[context.query]
+  query_runtime_state.was_authorized_by_scope_items = @object.was_authorized_by_scope_items?
+  @object.node
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/EdgeBehaviors/ClassMethods.html b/api-doc/2.1.6/GraphQL/Types/Relay/EdgeBehaviors/ClassMethods.html new file mode 100644 index 0000000000..e4cdaa6a2d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/EdgeBehaviors/ClassMethods.html @@ -0,0 +1,647 @@ + + + + + + + Module: GraphQL::Types::Relay::EdgeBehaviors::ClassMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::EdgeBehaviors::ClassMethods + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/relay/edge_behaviors.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + +
+

Instance Attribute Details

+ + + +
+

+ + #node_nullable(new_value = nil) ⇒ Object + + + + + +

+
+

Set the default node_nullable for this class and its child classes. (Defaults to true.) +Use node_nullable(false) in your base class to make non-null node field.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+67
+68
+69
+70
+71
+72
+73
+
+
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 67
+
+def node_nullable(new_value = nil)
+  if new_value.nil?
+    @node_nullable != nil ? @node_nullable : superclass.node_nullable
+  else
+    @node_nullable = new_value
+  end
+end
+
+
+ + + +
+

+ + #node_type(node_type = nil, null: self.node_nullable, field_options: nil) ⇒ Object + + + + + +

+
+

Get or set the Object type that this edge wraps.

+ + +
+
+
+

Parameters:

+
    + +
  • + + node_type + + + (Class) + + + (defaults to: nil) + + + — +

    A Schema::Object subclass

    +
    + +
  • + +
  • + + null + + + (Boolean) + + + (defaults to: self.node_nullable) + + +
  • + +
  • + + field_options + + + (Hash) + + + (defaults to: nil) + + + — +

    Any extra arguments to pass to the field :node configuration

    +
    + +
  • + +
+ + +
+ + + + +
+
+
+
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
+
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 38
+
+def node_type(node_type = nil, null: self.node_nullable, field_options: nil)
+  if node_type
+    @node_type = node_type
+    # Add a default `node` field
+    base_field_options = {
+      name: :node,
+      type: node_type,
+      null: null,
+      description: "The item at the end of the edge.",
+      connection: false,
+    }
+    if field_options
+      base_field_options.merge!(field_options)
+    end
+    field(**base_field_options)
+  end
+  @node_type
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #authorized?(obj, ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+57
+58
+59
+
+
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 57
+
+def authorized?(obj, ctx)
+  true
+end
+
+
+ +
+

+ + #default_relay?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+29
+30
+31
+
+
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 29
+
+def default_relay?
+  true
+end
+
+
+ +
+

+ + #inherited(child_class) ⇒ Object + + + + + +

+ + + + +
+
+
+
+23
+24
+25
+26
+27
+
+
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 23
+
+def inherited(child_class)
+  super
+  child_class.node_type = nil
+  child_class.node_nullable = nil
+end
+
+
+ +
+

+ + #visible?(ctx) ⇒ Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+61
+62
+63
+
+
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 61
+
+def visible?(ctx)
+  node_type.visible?(ctx)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/HasNodeField.html b/api-doc/2.1.6/GraphQL/Types/Relay/HasNodeField.html new file mode 100644 index 0000000000..7bf88259df --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/HasNodeField.html @@ -0,0 +1,272 @@ + + + + + + + Module: GraphQL::Types::Relay::HasNodeField + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::HasNodeField + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/relay/has_node_field.rb
+
+ +
+ +

Overview

+
+

Include this module to your root Query type to get a Relay-compliant node(id: ID!): Node field that uses the schema’s object_from_id hook.

+ + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .field_blockObject + + + + + +

+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
+
# File 'lib/graphql/types/relay/has_node_field.rb', line 23
+
+def field_block
+  Proc.new {
+    argument :id, "ID!",
+      description: "ID of the object."
+
+    def resolve(obj, args, ctx)
+      ctx.schema.object_from_id(args[:id], ctx)
+    end
+
+    def resolve_field(obj, args, ctx)
+      resolve(obj, args, ctx)
+    end
+  }
+end
+
+
+ +
+

+ + .field_optionsObject + + + + + +

+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/types/relay/has_node_field.rb', line 13
+
+def field_options
+  {
+    name: "node",
+    type: GraphQL::Types::Relay::Node,
+    null: true,
+    description: "Fetches an object given its ID.",
+    relay_node_field: true,
+  }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/HasNodesField.html b/api-doc/2.1.6/GraphQL/Types/Relay/HasNodesField.html new file mode 100644 index 0000000000..948447b6fe --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/HasNodesField.html @@ -0,0 +1,272 @@ + + + + + + + Module: GraphQL::Types::Relay::HasNodesField + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::HasNodesField + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/relay/has_nodes_field.rb
+
+ +
+ +

Overview

+
+

Include this module to your root Query type to get a Relay-style nodes(id: ID!): [Node] field that uses the schema’s object_from_id hook.

+ + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .field_blockObject + + + + + +

+ + + + +
+
+
+
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
+
# File 'lib/graphql/types/relay/has_nodes_field.rb', line 23
+
+def field_block
+  Proc.new {
+    argument :ids, "[ID!]!",
+      description: "IDs of the objects."
+
+    def resolve(obj, args, ctx)
+      args[:ids].map { |id| ctx.schema.object_from_id(id, ctx) }
+    end
+
+    def resolve_field(obj, args, ctx)
+      resolve(obj, args, ctx)
+    end
+  }
+end
+
+
+ +
+

+ + .field_optionsObject + + + + + +

+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/types/relay/has_nodes_field.rb', line 13
+
+def field_options
+  {
+    name: "nodes",
+    type: [GraphQL::Types::Relay::Node, null: true],
+    null: false,
+    description: "Fetches a list of objects given a list of IDs.",
+    relay_nodes_field: true,
+  }
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/Node.html b/api-doc/2.1.6/GraphQL/Types/Relay/Node.html new file mode 100644 index 0000000000..4e688fd2b6 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/Node.html @@ -0,0 +1,294 @@ + + + + + + + Module: GraphQL::Types::Relay::Node + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::Node + + + +

+
+ + + + + + +
+
Includes:
+
Schema::Interface, NodeBehaviors
+
+ + + + + + +
+
Defined in:
+
lib/graphql/types/relay/node.rb
+
+ +
+ +

Overview

+
+

This can be used for Relay’s Node interface, +or you can take it as inspiration for your own implementation +of the Node interface.

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + + + + + + + +

Method Summary

+ +

Methods included from NodeBehaviors

+

#default_global_id

+ + + + + + + + + +

Methods included from Schema::Interface

+

#unwrap

+ + + + + + + + + +

Methods included from Schema::Interface::DefinitionMethods

+

#definition_methods, #included, #kind, #orphan_types, #type_membership_class, #visible?

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/NodeBehaviors.html b/api-doc/2.1.6/GraphQL/Types/Relay/NodeBehaviors.html new file mode 100644 index 0000000000..eb871198ea --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/NodeBehaviors.html @@ -0,0 +1,190 @@ + + + + + + + Module: GraphQL::Types::Relay::NodeBehaviors + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::NodeBehaviors + + + +

+
+ + + + + + + + + +
+
Included in:
+
Node
+
+ + + +
+
Defined in:
+
lib/graphql/types/relay/node_behaviors.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: ClassMethods + + + + +

+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #default_global_idObject + + + + + +

+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'lib/graphql/types/relay/node_behaviors.rb', line 13
+
+def default_global_id
+  context.schema.id_from_object(object, self.class, context)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/NodeBehaviors/ClassMethods.html b/api-doc/2.1.6/GraphQL/Types/Relay/NodeBehaviors/ClassMethods.html new file mode 100644 index 0000000000..ee98560225 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/NodeBehaviors/ClassMethods.html @@ -0,0 +1,198 @@ + + + + + + + Module: GraphQL::Types::Relay::NodeBehaviors::ClassMethods + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::NodeBehaviors::ClassMethods + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/relay/node_behaviors.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #default_relay?Boolean + + + + + +

+
+ + + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+18
+19
+20
+
+
# File 'lib/graphql/types/relay/node_behaviors.rb', line 18
+
+def default_relay?
+  true
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/PageInfo.html b/api-doc/2.1.6/GraphQL/Types/Relay/PageInfo.html new file mode 100644 index 0000000000..7558029c92 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/PageInfo.html @@ -0,0 +1,318 @@ + + + + + + + Class: GraphQL::Types::Relay::PageInfo + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::Relay::PageInfo + + + +

+
+ +
+
Inherits:
+
+ Schema::Object + + + show all + +
+
+ + + + + + +
+
Includes:
+
PageInfoBehaviors
+
+ + + + + + +
+
Defined in:
+
lib/graphql/types/relay/page_info.rb
+
+ +
+ +

Overview

+
+

The return type of a connection’s pageInfo field

+ + +
+
+
+ + +
+ + +

Constant Summary

+ +

Constants included + from Schema::Member::HasFields

+

Schema::Member::HasFields::CONFLICT_FIELD_NAMES, Schema::Member::HasFields::GRAPHQL_RUBY_KEYWORDS, Schema::Member::HasFields::RUBY_KEYWORDS

+ + + +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes inherited from Schema::Object

+

#context, #object

+ + + +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from Schema::Object

+

authorized_new, const_missing, #dataloader, #initialize, kind, #raw_value, scoped_new, wrap, wrap_scoped

+ + + + + + + + + +

Methods included from Schema::Member::HasFields

+

#add_field, #all_field_definitions, #field, #field_class, #global_id_field, #own_fields

+ + + + + + + + + +

Methods included from Schema::Member::HasInterfaces

+

#implements, #interface_type_memberships, #interfaces, #own_interface_type_memberships

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + +
+

Constructor Details

+ +

This class inherits a constructor from GraphQL::Schema::Object

+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/Relay/PageInfoBehaviors.html b/api-doc/2.1.6/GraphQL/Types/Relay/PageInfoBehaviors.html new file mode 100644 index 0000000000..855d985256 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/Relay/PageInfoBehaviors.html @@ -0,0 +1,110 @@ + + + + + + + Module: GraphQL::Types::Relay::PageInfoBehaviors + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: GraphQL::Types::Relay::PageInfoBehaviors + + + +

+
+ + + + + + + + + +
+
Included in:
+
PageInfo
+
+ + + +
+
Defined in:
+
lib/graphql/types/relay/page_info_behaviors.rb
+
+ +
+ + + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/Types/String.html b/api-doc/2.1.6/GraphQL/Types/String.html new file mode 100644 index 0000000000..61ec5ae8f1 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/Types/String.html @@ -0,0 +1,412 @@ + + + + + + + Class: GraphQL::Types::String + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: GraphQL::Types::String + + + +

+
+ +
+
Inherits:
+
+ Schema::Scalar + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/types/string.rb
+
+ +
+ + + + +

Constant Summary

+ +

Constants included + from Schema::Member::GraphQLTypeNames

+

Schema::Member::GraphQLTypeNames::Boolean, Schema::Member::GraphQLTypeNames::ID, Schema::Member::GraphQLTypeNames::Int

+ + + + +

Instance Attribute Summary

+ +

Attributes included from Schema::Member::BaseDSLMethods

+

#default_graphql_name, #graphql_name

+ + + +

Attributes included from Schema::Member::RelayShortcuts

+

#connection_type, #connection_type_class, #edge_type, #edge_type_class

+ + + +

Attributes included from Schema::Member::HasAstNode

+

#ast_node

+ + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods inherited from Schema::Scalar

+

default_scalar, default_scalar?, kind, specified_by_url, validate_non_null_input

+ + + + + + + + + +

Methods included from Schema::Member::ValidatesInput

+

#coerce_isolated_input, #coerce_isolated_result, #valid_input?, #valid_isolated_input?, #validate_input

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods

+

#authorized?, #default_relay, #description, #introspection, #introspection?, #mutation, #name, #visible?

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::BaseDSLMethods::ConfigurationExtension

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::TypeSystemHelpers

+

#initialize, #kind, #list?, #non_null?, #to_list_type, #to_non_null_type, #to_type_signature

+ + + + + + + + + +

Methods included from Schema::Member::Scoped

+

#inherited, #reauthorize_scoped_objects, #scope_items

+ + + + + + + + + + + + + + + +

Methods included from Schema::Member::HasPath

+

#path

+ + + + + + + + + +

Methods included from Schema::Member::HasAstNode

+

#inherited

+ + + + + + + + + +

Methods included from Schema::Member::HasDirectives

+

add_directive, #directive, #directives, get_directives, #inherited, #remove_directive, remove_directive

+ + + + + + + + +
+

Class Method Details

+ + +
+

+ + .coerce_input(value, _ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+22
+23
+24
+
+
# File 'lib/graphql/types/string.rb', line 22
+
+def self.coerce_input(value, _ctx)
+  value.is_a?(::String) ? value : nil
+end
+
+
+ +
+

+ + .coerce_result(value, ctx) ⇒ Object + + + + + +

+ + + + +
+
+
+
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
+
# File 'lib/graphql/types/string.rb', line 8
+
+def self.coerce_result(value, ctx)
+  str = value.to_s
+  if str.encoding == Encoding::UTF_8 || str.ascii_only?
+    str
+  elsif str.frozen?
+    str.encode(Encoding::UTF_8)
+  else
+    str.encode!(Encoding::UTF_8)
+  end
+rescue EncodingError
+  err = GraphQL::StringEncodingError.new(str, context: ctx)
+  ctx.schema.type_error(err, ctx)
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/UnauthorizedError.html b/api-doc/2.1.6/GraphQL/UnauthorizedError.html new file mode 100644 index 0000000000..d3c8dcd65d --- /dev/null +++ b/api-doc/2.1.6/GraphQL/UnauthorizedError.html @@ -0,0 +1,514 @@ + + + + + + + Exception: GraphQL::UnauthorizedError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::UnauthorizedError + + + +

+
+ +
+
Inherits:
+
+ Error + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/unauthorized_error.rb
+
+ +
+ +

Overview

+
+

When an authorized? hook returns false, this error is used to communicate the failure. +It’s passed to Schema.unauthorized_object.

+ +

Alternatively, custom code in authorized? may raise this error. It will be routed the same way.

+ + +
+
+
+ + +
+

Direct Known Subclasses

+

UnauthorizedFieldError

+
+ + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #context ⇒ GraphQL::Query::Context + + + + + + + + + + + + + + + + +

    The context for the current query.

    +
    + +
  • + + +
  • + + + #object ⇒ Object + + + + + + + + + readonly + + + + + + + + + +

    The application object that failed the authorization check.

    +
    + +
  • + + +
  • + + + #type ⇒ Class + + + + + + + + + readonly + + + + + + + + + +

    The GraphQL object type whose .authorized? method was called (and returned false).

    +
    + +
  • + + +
+ + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message = nil, object: nil, type: nil, context: nil) ⇒ UnauthorizedError + + + + + +

+
+

Returns a new instance of UnauthorizedError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
+
# File 'lib/graphql/unauthorized_error.rb', line 17
+
+def initialize(message = nil, object: nil, type: nil, context: nil)
+  if message.nil? && object.nil? && type.nil?
+    raise ArgumentError, "#{self.class.name} requires either a message or keywords"
+  end
+
+  @object = object
+  @type = type
+  @context = context
+  message ||= "An instance of #{object.class} failed #{type.graphql_name}'s authorization check"
+  super(message)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #contextGraphQL::Query::Context + + + + + +

+
+

Returns the context for the current query.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+15
+16
+17
+
+
# File 'lib/graphql/unauthorized_error.rb', line 15
+
+def context
+  @context
+end
+
+
+ + + +
+

+ + #objectObject (readonly) + + + + + +

+
+

Returns the application object that failed the authorization check.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    the application object that failed the authorization check

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+9
+10
+11
+
+
# File 'lib/graphql/unauthorized_error.rb', line 9
+
+def object
+  @object
+end
+
+
+ + + +
+

+ + #typeClass (readonly) + + + + + +

+
+

Returns the GraphQL object type whose .authorized? method was called (and returned false).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Class) + + + + — +

    the GraphQL object type whose .authorized? method was called (and returned false)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+12
+13
+14
+
+
# File 'lib/graphql/unauthorized_error.rb', line 12
+
+def type
+  @type
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/UnauthorizedFieldError.html b/api-doc/2.1.6/GraphQL/UnauthorizedFieldError.html new file mode 100644 index 0000000000..1287208f02 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/UnauthorizedFieldError.html @@ -0,0 +1,344 @@ + + + + + + + Exception: GraphQL::UnauthorizedFieldError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::UnauthorizedFieldError + + + +

+
+ +
+
Inherits:
+
+ UnauthorizedError + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/unauthorized_field_error.rb
+
+ +
+ + + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #field ⇒ Field + + + + + + + + + + + + + + + + +

    The field that failed the authorization check.

    +
    + +
  • + + +
+ + + + + +

Attributes inherited from UnauthorizedError

+

#context, #object, #type

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(message = nil, object: nil, type: nil, context: nil, field: nil) ⇒ UnauthorizedFieldError + + + + + +

+
+

Returns a new instance of UnauthorizedFieldError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
+
# File 'lib/graphql/unauthorized_field_error.rb', line 7
+
+def initialize(message = nil, object: nil, type: nil, context: nil, field: nil)
+  if message.nil? && [field, type].any?(&:nil?)
+    raise ArgumentError, "#{self.class.name} requires either a message or keywords"
+  end
+
+  @field = field
+  message ||= begin
+    if object
+      "An instance of #{object.class} failed #{type.name}'s authorization check on field #{field.name}"
+    else
+      "Failed #{type.name}'s authorization check on field #{field.name}"
+    end
+  end
+  super(message, object: object, type: type, context: context)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #fieldField + + + + + +

+
+

Returns the field that failed the authorization check.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Field) + + + + — +

    the field that failed the authorization check

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+5
+6
+7
+
+
# File 'lib/graphql/unauthorized_field_error.rb', line 5
+
+def field
+  @field
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/GraphQL/UnresolvedTypeError.html b/api-doc/2.1.6/GraphQL/UnresolvedTypeError.html new file mode 100644 index 0000000000..3d558da211 --- /dev/null +++ b/api-doc/2.1.6/GraphQL/UnresolvedTypeError.html @@ -0,0 +1,696 @@ + + + + + + + Exception: GraphQL::UnresolvedTypeError + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Exception: GraphQL::UnresolvedTypeError + + + +

+
+ +
+
Inherits:
+
+ RuntimeTypeError + + + show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/graphql/unresolved_type_error.rb
+
+ +
+ +

Overview

+
+

Error raised when the value provided for a field +can’t be resolved to one of the possible types for the field.

+ + +
+
+
+ + +
+ + + +

Instance Attribute Summary collapse

+ + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + +
+

Constructor Details

+ +
+

+ + #initialize(value, field, parent_type, resolved_type, possible_types) ⇒ UnresolvedTypeError + + + + + +

+
+

Returns a new instance of UnresolvedTypeError.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
+
# File 'lib/graphql/unresolved_type_error.rb', line 21
+
+def initialize(value, field, parent_type, resolved_type, possible_types)
+  @value = value
+  @field = field
+  @parent_type = parent_type
+  @resolved_type = resolved_type
+  @possible_types = possible_types
+  message = "The value from \"#{field.graphql_name}\" on \"#{parent_type.graphql_name}\" could not be resolved to \"#{field.type.to_type_signature}\". " \
+    "(Received: `#{resolved_type.inspect}`, Expected: [#{possible_types.map(&:graphql_name).join(", ")}]) " \
+    "Make sure you have defined a `resolve_type` proc on your schema and that value `#{value.inspect}` " \
+    "gets resolved to a valid type. You may need to add your type to `orphan_types` if it implements an " \
+    "interface but isn't a return type of any other field."
+  super(message)
+end
+
+
+ +
+ +
+

Instance Attribute Details

+ + + +
+

+ + #fieldGraphQL::Field (readonly) + + + + + +

+
+

Returns The field whose value couldn’t be resolved (field.type is type which couldn’t be resolved).

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::Field) + + + + — +

    The field whose value couldn’t be resolved (field.type is type which couldn’t be resolved)

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+10
+11
+12
+
+
# File 'lib/graphql/unresolved_type_error.rb', line 10
+
+def field
+  @field
+end
+
+
+ + + +
+

+ + #parent_typeGraphQL::BaseType (readonly) + + + + + +

+
+

Returns The owner of field.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (GraphQL::BaseType) + + + + — +

    The owner of field

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'lib/graphql/unresolved_type_error.rb', line 13
+
+def parent_type
+  @parent_type
+end
+
+
+ + + +
+

+ + #possible_typesArray<GraphQL::BaseType> (readonly) + + + + + +

+
+

Returns The allowed options for resolving value to field.type.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Array<GraphQL::BaseType>) + + + + — +

    The allowed options for resolving value to field.type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+19
+20
+21
+
+
# File 'lib/graphql/unresolved_type_error.rb', line 19
+
+def possible_types
+  @possible_types
+end
+
+
+ + + +
+

+ + #resolved_typeObject (readonly) + + + + + +

+
+

Returns The return of Schema.resolve_type for value.

+ + +
+
+
+ +

Returns:

+ + +
+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/graphql/unresolved_type_error.rb', line 16
+
+def resolved_type
+  @resolved_type
+end
+
+
+ + + +
+

+ + #valueObject (readonly) + + + + + +

+
+

Returns The runtime value which couldn’t be successfully resolved with resolve_type.

+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Object) + + + + — +

    The runtime value which couldn’t be successfully resolved with resolve_type

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+7
+8
+9
+
+
# File 'lib/graphql/unresolved_type_error.rb', line 7
+
+def value
+  @value
+end
+
+
+ +
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators.html b/api-doc/2.1.6/Graphql/Generators.html new file mode 100644 index 0000000000..6ff6360784 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators.html @@ -0,0 +1,119 @@ + + + + + + + Module: Graphql::Generators + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: Graphql::Generators + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/core.rb,
+ lib/generators/graphql/relay.rb,
lib/generators/graphql/enum_generator.rb,
lib/generators/graphql/type_generator.rb,
lib/generators/graphql/field_extractor.rb,
lib/generators/graphql/input_generator.rb,
lib/generators/graphql/relay_generator.rb,
lib/generators/graphql/union_generator.rb,
lib/generators/graphql/loader_generator.rb,
lib/generators/graphql/object_generator.rb,
lib/generators/graphql/scalar_generator.rb,
lib/generators/graphql/install_generator.rb,
lib/generators/graphql/mutation_generator.rb,
lib/generators/graphql/orm_mutations_base.rb,
lib/generators/graphql/interface_generator.rb,
lib/generators/graphql/mutation_create_generator.rb,
lib/generators/graphql/mutation_delete_generator.rb,
lib/generators/graphql/mutation_update_generator.rb,
lib/generators/graphql/install/mutation_root_generator.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: Core, FieldExtractor, Install, Relay + + + + Classes: EnumGenerator, InputGenerator, InstallGenerator, InterfaceGenerator, LoaderGenerator, MutationCreateGenerator, MutationDeleteGenerator, MutationGenerator, MutationUpdateGenerator, ObjectGenerator, OrmMutationsBase, RelayGenerator, ScalarGenerator, TypeGeneratorBase, UnionGenerator + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/Core.html b/api-doc/2.1.6/Graphql/Generators/Core.html new file mode 100644 index 0000000000..2051a14b40 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/Core.html @@ -0,0 +1,367 @@ + + + + + + + Module: Graphql::Generators::Core + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: Graphql::Generators::Core + + + +

+
+ + + + + + + + + +
+
Included in:
+
Install::MutationRootGenerator, InstallGenerator, LoaderGenerator, MutationGenerator, OrmMutationsBase, RelayGenerator, TypeGeneratorBase
+
+ + + +
+
Defined in:
+
lib/generators/graphql/core.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #create_dir(dir) ⇒ Object + + + + + +

+ + + + +
+
+
+
+32
+33
+34
+35
+36
+37
+
+
# File 'lib/generators/graphql/core.rb', line 32
+
+def create_dir(dir)
+  empty_directory(dir)
+  if !options[:skip_keeps]
+    create_file("#{dir}/.keep")
+  end
+end
+
+
+ +
+

+ + #insert_root_type(type, name) ⇒ Object + + + + + +

+ + + + +
+
+
+
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
+
# File 'lib/generators/graphql/core.rb', line 17
+
+def insert_root_type(type, name)
+  log :add_root_type, type
+  sentinel = /< GraphQL::Schema\s*\n/m
+
+  in_root do
+    if File.exist?(schema_file_path)
+      inject_into_file schema_file_path, "  #{type}(Types::#{name})\n", after: sentinel, verbose: false, force: false
+    end
+  end
+end
+
+
+ +
+

+ + #module_namespacing_when_supportedObject + + + + + +

+ + + + +
+
+
+
+39
+40
+41
+42
+43
+44
+45
+
+
# File 'lib/generators/graphql/core.rb', line 39
+
+def module_namespacing_when_supported
+  if defined?(module_namespacing)
+    module_namespacing { yield }
+  else
+    yield
+  end
+end
+
+
+ +
+

+ + #schema_file_pathObject + + + + + +

+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/generators/graphql/core.rb', line 28
+
+def schema_file_path
+  "#{options[:directory]}/#{schema_name.underscore}.rb"
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/EnumGenerator.html b/api-doc/2.1.6/Graphql/Generators/EnumGenerator.html new file mode 100644 index 0000000000..f06a99fff2 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/EnumGenerator.html @@ -0,0 +1,163 @@ + + + + + + + Class: Graphql::Generators::EnumGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::EnumGenerator + + + +

+
+ +
+
Inherits:
+
+ TypeGeneratorBase + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/enum_generator.rb
+
+ +
+ +

Overview

+
+

Generate an enum type by name, with the given values. +To add a value: option, add another value after a :.

+ +

+rails g graphql:enum ProgrammingLanguage RUBY PYTHON PERL PERL6:"PERL" +

+ + +
+
+
+ + +
+ + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from TypeGeneratorBase

+

#create_type_file, normalize_type_expression

+ + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/FieldExtractor.html b/api-doc/2.1.6/Graphql/Generators/FieldExtractor.html new file mode 100644 index 0000000000..0e3ced96de --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/FieldExtractor.html @@ -0,0 +1,353 @@ + + + + + + + Module: Graphql::Generators::FieldExtractor + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: Graphql::Generators::FieldExtractor + + + +

+
+ + + + + + + + + +
+
Included in:
+
InputGenerator, ObjectGenerator
+
+ + + +
+
Defined in:
+
lib/generators/graphql/field_extractor.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #column_type_string(column) ⇒ Object + + + + + +

+ + + + +
+
+
+
+20
+21
+22
+
+
# File 'lib/generators/graphql/field_extractor.rb', line 20
+
+def column_type_string(column)
+  column.name == "id" ? "ID" : column.type.to_s.camelize
+end
+
+
+ +
+

+ + #fieldsObject + + + + + +

+ + + + +
+
+
+
+7
+8
+9
+10
+11
+
+
# File 'lib/generators/graphql/field_extractor.rb', line 7
+
+def fields
+  columns = []
+  columns += (klass&.columns&.map { |c| generate_column_string(c) }  || [])
+  columns + custom_fields
+end
+
+
+ +
+

+ + #generate_column_string(column) ⇒ Object + + + + + +

+ + + + +
+
+
+
+13
+14
+15
+16
+17
+18
+
+
# File 'lib/generators/graphql/field_extractor.rb', line 13
+
+def generate_column_string(column)
+  name = column.name
+  required = column.null ? "" : "!"
+  type = column_type_string(column)
+  "#{name}:#{required}#{type}"
+end
+
+
+ +
+

+ + #klassObject + + + + + +

+ + + + +
+
+
+
+24
+25
+26
+27
+28
+
+
# File 'lib/generators/graphql/field_extractor.rb', line 24
+
+def klass
+  @klass ||= Module.const_get(name.camelize)
+rescue NameError
+  @klass = nil
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/InputGenerator.html b/api-doc/2.1.6/Graphql/Generators/InputGenerator.html new file mode 100644 index 0000000000..5bcbb88de7 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/InputGenerator.html @@ -0,0 +1,275 @@ + + + + + + + Class: Graphql::Generators::InputGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::InputGenerator + + + +

+
+ +
+
Inherits:
+
+ TypeGeneratorBase + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
FieldExtractor
+
+ + + + + + +
+
Defined in:
+
lib/generators/graphql/input_generator.rb
+
+ +
+ +

Overview

+
+

Generate an input type by name, +with the specified fields.

+ +

+rails g graphql:object PostType name:string! +

+ + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from FieldExtractor

+

#column_type_string, #fields, #generate_column_string, #klass

+ + + + + + + + + +

Methods inherited from TypeGeneratorBase

+

#create_type_file

+ + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+

Class Method Details

+ + +
+

+ + .normalize_type_expression(type_expression, mode:, null: true) ⇒ Object + + + + + +

+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
+
# File 'lib/generators/graphql/input_generator.rb', line 18
+
+def self.normalize_type_expression(type_expression, mode:, null: true)
+  case type_expression.camelize
+  when "Text", "Citext"
+    ["String", null]
+  when "Decimal"
+    ["Float", null]
+  when "DateTime", "Datetime"
+    ["GraphQL::Types::ISO8601DateTime", null]
+  when "Date"
+    ["GraphQL::Types::ISO8601Date", null]
+  when "Json", "Jsonb", "Hstore"
+    ["GraphQL::Types::JSON", null]
+  else
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/Install.html b/api-doc/2.1.6/Graphql/Generators/Install.html new file mode 100644 index 0000000000..602d5d3f49 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/Install.html @@ -0,0 +1,115 @@ + + + + + + + Module: Graphql::Generators::Install + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: Graphql::Generators::Install + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/install/mutation_root_generator.rb
+
+ +
+ +

Defined Under Namespace

+

+ + + + + Classes: MutationRootGenerator + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/Install/MutationRootGenerator.html b/api-doc/2.1.6/Graphql/Generators/Install/MutationRootGenerator.html new file mode 100644 index 0000000000..6384766179 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/Install/MutationRootGenerator.html @@ -0,0 +1,216 @@ + + + + + + + Class: Graphql::Generators::Install::MutationRootGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::Install::MutationRootGenerator + + + +

+
+ +
+
Inherits:
+
+ Rails::Generators::Base + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Core
+
+ + + + + + +
+
Defined in:
+
lib/generators/graphql/install/mutation_root_generator.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+

Instance Method Details

+ + +
+

+ + #generateObject + + + + + +

+ + + + +
+
+
+
+25
+26
+27
+28
+29
+30
+
+
# File 'lib/generators/graphql/install/mutation_root_generator.rb', line 25
+
+def generate
+  create_dir("#{options[:directory]}/mutations")
+  template("base_mutation.erb", "#{options[:directory]}/mutations/base_mutation.rb", { skip: true })
+  template("mutation_type.erb", "#{options[:directory]}/types/mutation_type.rb", { skip: true })
+  insert_root_type('mutation', 'MutationType') 
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/InstallGenerator.html b/api-doc/2.1.6/Graphql/Generators/InstallGenerator.html new file mode 100644 index 0000000000..39ea029b84 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/InstallGenerator.html @@ -0,0 +1,436 @@ + + + + + + + Class: Graphql::Generators::InstallGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::InstallGenerator + + + +

+
+ +
+
Inherits:
+
+ Rails::Generators::Base + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Core, Relay
+
+ + + + + + +
+
Defined in:
+
lib/generators/graphql/install_generator.rb
+
+ +
+ +

Overview

+
+

Add GraphQL to a Rails app with rails g graphql:install.

+ +

Setup a folder structure for GraphQL:

+ +

+- app/ + - graphql/ + - resolvers/ + - types/ + - base_argument.rb + - base_field.rb + - base_enum.rb + - base_input_object.rb + - base_interface.rb + - base_object.rb + - base_scalar.rb + - base_union.rb + - query_type.rb + - loaders/ + - mutations/ + - base_mutation.rb + - {app_name}_schema.rb +

+ +

(Add .gitkeeps by default, support --skip-keeps)

+ +

Add a controller for serving GraphQL queries:

+ +

+app/controllers/graphql_controller.rb +

+ +

Add a route for that controller:

+ +

ruby +# config/routes.rb +post "/graphql", to: "graphql#execute" +

+ +

Accept a --batch option which adds GraphQL::Batch setup.

+ +

Use --skip-graphiql to skip graphiql-rails installation.

+ +

TODO: also add base classes

+ + +
+
+
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Relay

+

#install_relay

+ + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+

Instance Method Details

+ + +
+

+ + #create_folder_structureObject + + + + + +

+ + + + +
+
+
+
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+
+
# File 'lib/generators/graphql/install_generator.rb', line 100
+
+def create_folder_structure
+  create_dir("#{options[:directory]}/types")
+  template("schema.erb", schema_file_path)
+
+  ["base_object", "base_argument", "base_field", "base_enum", "base_input_object", "base_interface", "base_scalar", "base_union"].each do |base_type|
+    template("#{base_type}.erb", "#{options[:directory]}/types/#{base_type}.rb")
+  end
+
+  # Note: You can't have a schema without the query type, otherwise introspection breaks
+  template("query_type.erb", "#{options[:directory]}/types/query_type.rb")
+  insert_root_type('query', 'QueryType')
+
+  invoke "graphql:install:mutation_root" unless options.skip_mutation_root_type?
+
+  template("graphql_controller.erb", "app/controllers/graphql_controller.rb")
+  route('post "/graphql", to: "graphql#execute"')
+
+  if options[:batch]
+    gem("graphql-batch")
+    create_dir("#{options[:directory]}/loaders")
+  end
+
+  if options.api?
+    say("Skipped graphiql, as this rails project is API only")
+    say("  You may wish to use GraphiQL.app for development: https://github.com/skevy/graphiql-app")
+  elsif !options[:skip_graphiql]
+    # `gem(...)` uses `gsub_file(...)` under the hood, which is a no-op for `rails destroy...` (when `behavior == :revoke`).
+    # So handle that case by calling `gsub_file` with `force: true`.
+    if behavior == :invoke && !File.read(Rails.root.join("Gemfile")).include?("graphiql-rails")
+      gem("graphiql-rails", group: :development)
+    elsif behavior == :revoke
+      gemfile_pattern = /\n\s*gem ('|")graphiql-rails('|"), :?group(:| =>) :development/
+      gsub_file Rails.root.join("Gemfile"), gemfile_pattern, "", { force: true }
+    end
+
+    # This is a little cheat just to get cleaner shell output:
+    log :route, 'graphiql-rails'
+    shell.mute do
+      # Rails 5.2 has better support for `route`?
+      if Rails::VERSION::STRING > "5.2"
+        route <<-RUBY
+if Rails.env.development?
+  mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql"
+end
+RUBY
+      else
+        route <<-RUBY
+if Rails.env.development?
+    mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql"
+  end
+RUBY
+      end
+    end
+  end
+
+  if options[:playground]
+    gem("graphql_playground-rails", group: :development)
+
+    log :route, 'graphql_playground-rails'
+    shell.mute do
+      if Rails::VERSION::STRING > "5.2"
+        route <<-RUBY
+if Rails.env.development?
+  mount GraphqlPlayground::Rails::Engine, at: "/playground", graphql_path: "/graphql"
+end
+RUBY
+      else
+        route <<-RUBY
+if Rails.env.development?
+    mount GraphqlPlayground::Rails::Engine, at: "/playground", graphql_path: "/graphql"
+  end
+RUBY
+      end
+    end
+  end
+
+  if options[:relay]
+    install_relay
+  end
+
+  if gemfile_modified?
+    say "Gemfile has been modified, make sure you `bundle install`"
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/InterfaceGenerator.html b/api-doc/2.1.6/Graphql/Generators/InterfaceGenerator.html new file mode 100644 index 0000000000..96895c3724 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/InterfaceGenerator.html @@ -0,0 +1,163 @@ + + + + + + + Class: Graphql::Generators::InterfaceGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::InterfaceGenerator + + + +

+
+ +
+
Inherits:
+
+ TypeGeneratorBase + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/interface_generator.rb
+
+ +
+ +

Overview

+
+

Generate an interface type by name, +with the specified fields.

+ +

+rails g graphql:interface NamedEntityType name:String! +

+ + +
+
+
+ + +
+ + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from TypeGeneratorBase

+

#create_type_file, normalize_type_expression

+ + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/LoaderGenerator.html b/api-doc/2.1.6/Graphql/Generators/LoaderGenerator.html new file mode 100644 index 0000000000..8371f300ee --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/LoaderGenerator.html @@ -0,0 +1,231 @@ + + + + + + + Class: Graphql::Generators::LoaderGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::LoaderGenerator + + + +

+
+ +
+
Inherits:
+
+ Rails::Generators::NamedBase + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Core
+
+ + + + + + +
+
Defined in:
+
lib/generators/graphql/loader_generator.rb
+
+ +
+ +

Overview

+
+ + + +
+
+
+ +
+

Examples:

+ + +

Generate a GraphQL::Batch loader by name.

+

+ +
rails g graphql:loader RecordLoader
+ +
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+

Instance Method Details

+ + +
+

+ + #create_loader_fileObject + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/generators/graphql/loader_generator.rb', line 16
+
+def create_loader_file
+  template "loader.erb", "#{options[:directory]}/loaders/#{file_path}.rb"
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/MutationCreateGenerator.html b/api-doc/2.1.6/Graphql/Generators/MutationCreateGenerator.html new file mode 100644 index 0000000000..5cf432fb92 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/MutationCreateGenerator.html @@ -0,0 +1,170 @@ + + + + + + + Class: Graphql::Generators::MutationCreateGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::MutationCreateGenerator + + + +

+
+ +
+
Inherits:
+
+ OrmMutationsBase + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/mutation_create_generator.rb
+
+ +
+ +

Overview

+
+

TODO: What other options should be supported?

+ + +
+
+
+ +
+

Examples:

+ + +

Generate a GraphQL::Schema::RelayClassicMutation by name

+

+ +
rails g graphql:mutation CreatePostMutation
+ +
+ + +
+ + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from OrmMutationsBase

+

#create_mutation_file

+ + + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/MutationDeleteGenerator.html b/api-doc/2.1.6/Graphql/Generators/MutationDeleteGenerator.html new file mode 100644 index 0000000000..575381b7d5 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/MutationDeleteGenerator.html @@ -0,0 +1,170 @@ + + + + + + + Class: Graphql::Generators::MutationDeleteGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::MutationDeleteGenerator + + + +

+
+ +
+
Inherits:
+
+ OrmMutationsBase + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/mutation_delete_generator.rb
+
+ +
+ +

Overview

+
+

TODO: What other options should be supported?

+ + +
+
+
+ +
+

Examples:

+ + +

Generate a GraphQL::Schema::RelayClassicMutation by name

+

+ +
rails g graphql:mutation DeletePostMutation
+ +
+ + +
+ + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from OrmMutationsBase

+

#create_mutation_file

+ + + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/MutationGenerator.html b/api-doc/2.1.6/Graphql/Generators/MutationGenerator.html new file mode 100644 index 0000000000..9ffe411778 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/MutationGenerator.html @@ -0,0 +1,245 @@ + + + + + + + Class: Graphql::Generators::MutationGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::MutationGenerator + + + +

+
+ +
+
Inherits:
+
+ Rails::Generators::NamedBase + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Core
+
+ + + + + + +
+
Defined in:
+
lib/generators/graphql/mutation_generator.rb
+
+ +
+ +

Overview

+
+

TODO: What other options should be supported?

+ + +
+
+
+ +
+

Examples:

+ + +

Generate a GraphQL::Schema::RelayClassicMutation by name

+

+ +
rails g graphql:mutation CreatePostMutation
+ +
+ + +
+ + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+

Instance Method Details

+ + +
+

+ + #create_mutation_fileObject + + + + + +

+ + + + +
+
+
+
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+
+
# File 'lib/generators/graphql/mutation_generator.rb', line 18
+
+def create_mutation_file
+  template "mutation.erb", File.join(options[:directory], "/mutations/", class_path, "#{file_name}.rb")
+
+  sentinel = /class .*MutationType\s*<\s*[^\s]+?\n/m
+  in_root do
+    path = "#{options[:directory]}/types/mutation_type.rb"
+    invoke "graphql:install:mutation_root" unless File.exist?(path)
+    inject_into_file "#{options[:directory]}/types/mutation_type.rb", "    field :#{file_name}, mutation: Mutations::#{class_name}\n", after: sentinel, verbose: false, force: false
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/MutationUpdateGenerator.html b/api-doc/2.1.6/Graphql/Generators/MutationUpdateGenerator.html new file mode 100644 index 0000000000..4d02be2b79 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/MutationUpdateGenerator.html @@ -0,0 +1,170 @@ + + + + + + + Class: Graphql::Generators::MutationUpdateGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::MutationUpdateGenerator + + + +

+
+ +
+
Inherits:
+
+ OrmMutationsBase + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/mutation_update_generator.rb
+
+ +
+ +

Overview

+
+

TODO: What other options should be supported?

+ + +
+
+
+ +
+

Examples:

+ + +

Generate a GraphQL::Schema::RelayClassicMutation by name

+

+ +
rails g graphql:mutation UpdatePostMutation
+ +
+ + +
+ + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from OrmMutationsBase

+

#create_mutation_file

+ + + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/ObjectGenerator.html b/api-doc/2.1.6/Graphql/Generators/ObjectGenerator.html new file mode 100644 index 0000000000..2f7064ac66 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/ObjectGenerator.html @@ -0,0 +1,277 @@ + + + + + + + Class: Graphql::Generators::ObjectGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::ObjectGenerator + + + +

+
+ +
+
Inherits:
+
+ TypeGeneratorBase + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
FieldExtractor
+
+ + + + + + +
+
Defined in:
+
lib/generators/graphql/object_generator.rb
+
+ +
+ +

Overview

+
+

Generate an object type by name, +with the specified fields.

+ +

+rails g graphql:object PostType name:String! +

+ +

Add the Node interface with --node.

+ + +
+
+
+ + +
+ + + + + + + +

+ Class Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from FieldExtractor

+

#column_type_string, #fields, #generate_column_string, #klass

+ + + + + + + + + +

Methods inherited from TypeGeneratorBase

+

#create_type_file

+ + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+

Class Method Details

+ + +
+

+ + .normalize_type_expression(type_expression, mode:, null: true) ⇒ Object + + + + + +

+ + + + +
+
+
+
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
+
# File 'lib/generators/graphql/object_generator.rb', line 26
+
+def self.normalize_type_expression(type_expression, mode:, null: true)
+  case type_expression.camelize
+  when "Text", "Citext"
+    ["String", null]
+  when "Decimal"
+    ["Float", null]
+  when "DateTime", "Datetime"
+    ["GraphQL::Types::ISO8601DateTime", null]
+  when "Date"
+    ["GraphQL::Types::ISO8601Date", null]
+  when "Json", "Jsonb", "Hstore"
+    ["GraphQL::Types::JSON", null]
+  else
+    super
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/OrmMutationsBase.html b/api-doc/2.1.6/Graphql/Generators/OrmMutationsBase.html new file mode 100644 index 0000000000..2e3b4f7af8 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/OrmMutationsBase.html @@ -0,0 +1,250 @@ + + + + + + + Class: Graphql::Generators::OrmMutationsBase + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::OrmMutationsBase + + + +

+
+ +
+
Inherits:
+
+ Rails::Generators::NamedBase + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Core, Rails::Generators::ResourceHelpers
+
+ + + + + + +
+
Defined in:
+
lib/generators/graphql/orm_mutations_base.rb
+
+ +
+ +

Overview

+
+

TODO: What other options should be supported?

+ + +
+
+
+ +
+

Examples:

+ + +

Generate a GraphQL::Schema::RelayClassicMutation by name

+

+ +
rails g graphql:mutation CreatePostMutation
+ +
+ + +
+ + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+

Instance Method Details

+ + +
+

+ + #create_mutation_fileObject + + + + + +

+ + + + +
+
+
+
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+
+
# File 'lib/generators/graphql/orm_mutations_base.rb', line 28
+
+def create_mutation_file
+  template "mutation_#{operation_type}.erb", File.join(options[:directory], "/mutations/", class_path, "#{file_name}_#{operation_type}.rb")
+
+  sentinel = /class .*MutationType\s*<\s*[^\s]+?\n/m
+  in_root do
+    path = "#{options[:directory]}/types/mutation_type.rb"
+    invoke "graphql:install:mutation_root" unless File.exist?(path)
+    inject_into_file "#{options[:directory]}/types/mutation_type.rb", "    field :#{file_name}_#{operation_type}, mutation: Mutations::#{class_name}#{operation_type.classify}\n", after: sentinel, verbose: false, force: false
+  end
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/Relay.html b/api-doc/2.1.6/Graphql/Generators/Relay.html new file mode 100644 index 0000000000..930e9b1fad --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/Relay.html @@ -0,0 +1,292 @@ + + + + + + + Module: Graphql::Generators::Relay + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: Graphql::Generators::Relay + + + +

+
+ + + + + + + + + +
+
Included in:
+
InstallGenerator, RelayGenerator
+
+ + + +
+
Defined in:
+
lib/generators/graphql/relay.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + +
+

Instance Method Details

+ + +
+

+ + #install_relayObject + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
+
# File 'lib/generators/graphql/relay.rb', line 5
+
+def install_relay
+  # Add Node, `node(id:)`, and `nodes(ids:)`
+  template("node_type.erb", "#{options[:directory]}/types/node_type.rb")
+  in_root do
+    fields = <<-RUBY
+    field :node, Types::NodeType, null: true, description: "Fetches an object given its ID." do
+argument :id, ID, required: true, description: "ID of the object."
+    end
+
+    def node(id:)
+context.schema.object_from_id(id, context)
+    end
+
+    field :nodes, [Types::NodeType, null: true], null: true, description: "Fetches a list of objects given a list of IDs." do
+argument :ids, [ID], required: true, description: "IDs of the objects."
+    end
+
+    def nodes(ids:)
+ids.map { |id| context.schema.object_from_id(id, context) }
+    end
+
+    RUBY
+    inject_into_file "#{options[:directory]}/types/query_type.rb", fields, after: /class .*QueryType\s*<\s*[^\s]+?\n/m, force: false
+  end
+
+  # Add connections and edges
+  template("base_connection.erb", "#{options[:directory]}/types/base_connection.rb")
+  template("base_edge.erb", "#{options[:directory]}/types/base_edge.rb")
+  connectionable_type_files = {
+    "#{options[:directory]}/types/base_object.rb" => /class .*BaseObject\s*<\s*[^\s]+?\n/m,
+    "#{options[:directory]}/types/base_union.rb" =>  /class .*BaseUnion\s*<\s*[^\s]+?\n/m,
+    "#{options[:directory]}/types/base_interface.rb" => /include GraphQL::Schema::Interface\n/m,
+  }
+  in_root do
+    connectionable_type_files.each do |type_class_file, sentinel|
+      inject_into_file type_class_file, "    connection_type_class(Types::BaseConnection)\n", after: sentinel, force: false
+      inject_into_file type_class_file, "    edge_type_class(Types::BaseEdge)\n", after: sentinel, force: false
+    end
+  end
+
+  # Add object ID hooks & connection plugin
+  schema_code = <<-RUBY
+
+  # 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
+RUBY
+  inject_into_file schema_file_path, schema_code, before: /^end\n/m, force: false
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/RelayGenerator.html b/api-doc/2.1.6/Graphql/Generators/RelayGenerator.html new file mode 100644 index 0000000000..676c6e93c3 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/RelayGenerator.html @@ -0,0 +1,216 @@ + + + + + + + Class: Graphql::Generators::RelayGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::RelayGenerator + + + +

+
+ +
+
Inherits:
+
+ Rails::Generators::Base + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Core, Relay
+
+ + + + + + +
+
Defined in:
+
lib/generators/graphql/relay_generator.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+

Instance Method Details

+ + +
+

+ + #install_relayObject + + + + + +

+ + + + +
+
+
+
+16
+17
+18
+
+
# File 'lib/generators/graphql/relay_generator.rb', line 16
+
+def install_relay
+  super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/ScalarGenerator.html b/api-doc/2.1.6/Graphql/Generators/ScalarGenerator.html new file mode 100644 index 0000000000..8fbeecb6c1 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/ScalarGenerator.html @@ -0,0 +1,162 @@ + + + + + + + Class: Graphql::Generators::ScalarGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::ScalarGenerator + + + +

+
+ +
+
Inherits:
+
+ TypeGeneratorBase + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/scalar_generator.rb
+
+ +
+ +

Overview

+
+

Generate a scalar type by given name.

+ +

+rails g graphql:scalar Date +

+ + +
+
+
+ + +
+ + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from TypeGeneratorBase

+

#create_type_file, normalize_type_expression

+ + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/TypeGeneratorBase.html b/api-doc/2.1.6/Graphql/Generators/TypeGeneratorBase.html new file mode 100644 index 0000000000..11479a2842 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/TypeGeneratorBase.html @@ -0,0 +1,496 @@ + + + + + + + Class: Graphql::Generators::TypeGeneratorBase + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::TypeGeneratorBase + + + +

+
+ +
+
Inherits:
+
+ Rails::Generators::NamedBase + +
    +
  • Object
  • + + + + + +
+ show all + +
+
+ + + + + + +
+
Includes:
+
Core
+
+ + + + + + +
+
Defined in:
+
lib/generators/graphql/type_generator.rb
+
+ +
+ + +

Defined Under Namespace

+

+ + + + + Classes: NormalizedField + + +

+ + + + +

Instance Attribute Summary collapse

+
    + +
  • + + + #graphql_type ⇒ Object + + + + + + + + + + + + + + + + +

    Returns the value of attribute graphql_type.

    +
    + +
  • + + +
+ + + + + +

+ Class Method Summary + collapse +

+ + + +

+ Instance Method Summary + collapse +

+ + + + + + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + +
+

Instance Attribute Details

+ + + +
+

+ + #graphql_typeObject + + + + + +

+
+

Returns the value of attribute graphql_type.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+28
+29
+30
+
+
# File 'lib/generators/graphql/type_generator.rb', line 28
+
+def graphql_type
+  @graphql_type
+end
+
+
+ +
+ + +
+

Class Method Details

+ + +
+

+ + .normalize_type_expression(type_expression, mode:, null: true) ⇒ (String, Boolean) + + + + + +

+
+

Take a type expression in any combination of GraphQL or Ruby styles +and return it in a specified output style +TODO: nullability / list with mode: :graphql doesn’t work

+ + +
+
+
+

Parameters:

+
    + +
  • + + type_expresson + + + (String) + + + +
  • + +
  • + + mode + + + (Symbol) + + + +
  • + +
  • + + null + + + (Boolean) + + + (defaults to: true) + + +
  • + +
+ +

Returns:

+
    + +
  • + + + ((String, Boolean)) + + + + — +

    The type expression, followed by null: value

    +
    + +
  • + +
+ +
+ + + + +
+
+
+
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
+
# File 'lib/generators/graphql/type_generator.rb', line 41
+
+def self.normalize_type_expression(type_expression, mode:, null: true)
+  if type_expression.start_with?("!")
+    normalize_type_expression(type_expression[1..-1], mode: mode, null: false)
+  elsif type_expression.end_with?("!")
+    normalize_type_expression(type_expression[0..-2], mode: mode, null: false)
+  elsif type_expression.start_with?("[") && type_expression.end_with?("]")
+    name, is_null = normalize_type_expression(type_expression[1..-2], mode: mode, null: null)
+    ["[#{name}]", is_null]
+  elsif type_expression.end_with?("Type")
+    normalize_type_expression(type_expression[0..-5], mode: mode, null: null)
+  elsif type_expression.start_with?("Types::")
+    normalize_type_expression(type_expression[7..-1], mode: mode, null: null)
+  elsif type_expression.start_with?("types.")
+    normalize_type_expression(type_expression[6..-1], mode: mode, null: null)
+  else
+    case mode
+    when :ruby
+      case type_expression
+      when "Int"
+        ["Integer", null]
+      when "Integer", "Float", "Boolean", "String", "ID"
+        [type_expression, null]
+      else
+        ["Types::#{type_expression.camelize}Type", null]
+      end
+    when :graphql
+      [type_expression.camelize, null]
+    else
+      raise "Unexpected normalize mode: #{mode}"
+    end
+  end
+end
+
+
+ +
+ +
+

Instance Method Details

+ + +
+

+ + #create_type_fileObject + + + + + +

+ + + + +
+
+
+
+30
+31
+32
+
+
# File 'lib/generators/graphql/type_generator.rb', line 30
+
+def create_type_file
+  template "#{graphql_type}.erb", "#{options[:directory]}/types#{subdirectory}/#{type_file_name}.rb"
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/TypeGeneratorBase/NormalizedField.html b/api-doc/2.1.6/Graphql/Generators/TypeGeneratorBase/NormalizedField.html new file mode 100644 index 0000000000..8e7081cf7f --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/TypeGeneratorBase/NormalizedField.html @@ -0,0 +1,317 @@ + + + + + + + Class: Graphql::Generators::TypeGeneratorBase::NormalizedField + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::TypeGeneratorBase::NormalizedField + + + +

+
+ +
+
Inherits:
+
+ Object + +
    +
  • Object
  • + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/type_generator.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Constructor Details

+ +
+

+ + #initialize(name, type_expr, null) ⇒ NormalizedField + + + + + +

+
+

Returns a new instance of NormalizedField.

+ + +
+
+
+ + +
+ + + + +
+
+
+
+119
+120
+121
+122
+123
+
+
# File 'lib/generators/graphql/type_generator.rb', line 119
+
+def initialize(name, type_expr, null)
+  @name = name
+  @type_expr = type_expr
+  @null = null
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #to_input_argumentObject + + + + + +

+ + + + +
+
+
+
+129
+130
+131
+
+
# File 'lib/generators/graphql/type_generator.rb', line 129
+
+def to_input_argument
+  "argument :#{@name}, #{@type_expr}, required: false"
+end
+
+
+ +
+

+ + #to_object_fieldObject + + + + + +

+ + + + +
+
+
+
+125
+126
+127
+
+
# File 'lib/generators/graphql/type_generator.rb', line 125
+
+def to_object_field
+  "field :#{@name}, #{@type_expr}#{@null ? '' : ', null: false'}"
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql/Generators/UnionGenerator.html b/api-doc/2.1.6/Graphql/Generators/UnionGenerator.html new file mode 100644 index 0000000000..894f9597e1 --- /dev/null +++ b/api-doc/2.1.6/Graphql/Generators/UnionGenerator.html @@ -0,0 +1,163 @@ + + + + + + + Class: Graphql::Generators::UnionGenerator + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Class: Graphql::Generators::UnionGenerator + + + +

+
+ +
+
Inherits:
+
+ TypeGeneratorBase + +
    +
  • Object
  • + + + + + + + +
+ show all + +
+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/union_generator.rb
+
+ +
+ +

Overview

+
+

Generate a union type by name +with the specified member types.

+ +

+rails g graphql:union SearchResultType ImageType AudioType +

+ + +
+
+
+ + +
+ + + + + + + + + + + + + +

Method Summary

+ +

Methods inherited from TypeGeneratorBase

+

#create_type_file, normalize_type_expression

+ + + + + + + + + +

Methods included from Core

+

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

+ + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/Graphql_.html b/api-doc/2.1.6/Graphql_.html new file mode 100644 index 0000000000..8e2e7898d3 --- /dev/null +++ b/api-doc/2.1.6/Graphql_.html @@ -0,0 +1,117 @@ + + + + + + + Module: Graphql + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Module: Graphql + + + +

+
+ + + + + + + + + + + +
+
Defined in:
+
lib/generators/graphql/core.rb,
+ lib/generators/graphql/relay.rb,
lib/generators/graphql/enum_generator.rb,
lib/generators/graphql/type_generator.rb,
lib/generators/graphql/field_extractor.rb,
lib/generators/graphql/input_generator.rb,
lib/generators/graphql/relay_generator.rb,
lib/generators/graphql/union_generator.rb,
lib/generators/graphql/loader_generator.rb,
lib/generators/graphql/object_generator.rb,
lib/generators/graphql/scalar_generator.rb,
lib/generators/graphql/install_generator.rb,
lib/generators/graphql/mutation_generator.rb,
lib/generators/graphql/orm_mutations_base.rb,
lib/generators/graphql/interface_generator.rb,
lib/generators/graphql/mutation_create_generator.rb,
lib/generators/graphql/mutation_delete_generator.rb,
lib/generators/graphql/mutation_update_generator.rb,
lib/generators/graphql/install/mutation_root_generator.rb
+
+
+ +
+ +

Defined Under Namespace

+

+ + + Modules: Generators + + + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/_index.html b/api-doc/2.1.6/_index.html new file mode 100644 index 0000000000..aaa6f6ca4e --- /dev/null +++ b/api-doc/2.1.6/_index.html @@ -0,0 +1,3462 @@ + + + + + + + GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

GraphQL Ruby API Documentation

+
+

Alphabetic Index

+ +

File Listing

+ + +
+

Namespace Listing A-Z

+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
  • J
  • +
      + +
    • + JSON + + (GraphQL::Types) + +
    • + +
    +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
    +
  • W
  • +
      + +
    • + Warden + + (GraphQL::Schema) + +
    • + +
    • + Wrapper + + (GraphQL::Schema) + +
    • + +
    • + WrapperType + + (GraphQL::Language::Nodes) + +
    • + +
    +
+ +
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/api-doc/2.1.6/class_list.html b/api-doc/2.1.6/class_list.html new file mode 100644 index 0000000000..2fd580fed6 --- /dev/null +++ b/api-doc/2.1.6/class_list.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + Class List + + + +
+
+

Class List

+ + + +
+ + +
+ + diff --git a/api-doc/2.1.6/css/common.css b/api-doc/2.1.6/css/common.css new file mode 100644 index 0000000000..cf25c45233 --- /dev/null +++ b/api-doc/2.1.6/css/common.css @@ -0,0 +1 @@ +/* Override this file with custom rules */ \ No newline at end of file diff --git a/api-doc/2.1.6/css/full_list.css b/api-doc/2.1.6/css/full_list.css new file mode 100644 index 0000000000..fa35982429 --- /dev/null +++ b/api-doc/2.1.6/css/full_list.css @@ -0,0 +1,58 @@ +body { + margin: 0; + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + height: 101%; + overflow-x: hidden; + background: #fafafa; +} + +h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } +.clear { clear: both; } +.fixed_header { position: fixed; background: #fff; width: 100%; padding-bottom: 10px; margin-top: 0; top: 0; z-index: 9999; height: 70px; } +#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } +#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } +#full_list { padding: 0; list-style: none; margin-left: 0; margin-top: 80px; font-size: 1.1em; } +#full_list ul { padding: 0; } +#full_list li { padding: 0; margin: 0; list-style: none; } +#full_list li .item { padding: 5px 5px 5px 12px; } +#noresults { padding: 7px 12px; background: #fff; } +#content.insearch #noresults { margin-left: 7px; } +li.collapsed ul { display: none; } +li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } +li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } +li { color: #888; cursor: pointer; } +li.deprecated { text-decoration: line-through; font-style: italic; } +li.odd { background: #f0f0f0; } +li.even { background: #fafafa; } +.item:hover { background: #ddd; } +li small:before { content: "("; } +li small:after { content: ")"; } +li small.search_info { display: none; } +a, a:visited { text-decoration: none; color: #05a; } +li.clicked > .item { background: #05a; color: #ccc; } +li.clicked > .item a, li.clicked > .item a:visited { color: #eee; } +li.clicked > .item a.toggle { opacity: 0.5; background-position: bottom right; } +li.collapsed.clicked a.toggle { background-position: top right; } +#search input { border: 1px solid #bbb; border-radius: 3px; } +#full_list_nav { margin-left: 10px; font-size: 0.9em; display: block; color: #aaa; } +#full_list_nav a, #nav a:visited { color: #358; } +#full_list_nav a:hover { background: transparent; color: #5af; } +#full_list_nav span:after { content: ' | '; } +#full_list_nav span:last-child:after { content: ''; } + +#content h1 { margin-top: 0; } +li { white-space: nowrap; cursor: normal; } +li small { display: block; font-size: 0.8em; } +li small:before { content: ""; } +li small:after { content: ""; } +li small.search_info { display: none; } +#search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } +#content.insearch #search { background-position: center right; } +#search input { width: 110px; } + +#full_list.insearch ul { display: block; } +#full_list.insearch .item { display: none; } +#full_list.insearch .found { display: block; padding-left: 11px !important; } +#full_list.insearch li a.toggle { display: none; } +#full_list.insearch li small.search_info { display: block; } diff --git a/api-doc/2.1.6/css/style.css b/api-doc/2.1.6/css/style.css new file mode 100644 index 0000000000..eb0dbc86f6 --- /dev/null +++ b/api-doc/2.1.6/css/style.css @@ -0,0 +1,497 @@ +html { + width: 100%; + height: 100%; +} +body { + font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; + font-size: 13px; + width: 100%; + margin: 0; + padding: 0; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; +} + +#nav { + position: relative; + width: 100%; + height: 100%; + border: 0; + border-right: 1px dotted #eee; + overflow: auto; +} +.nav_wrap { + margin: 0; + padding: 0; + width: 20%; + height: 100%; + position: relative; + display: flex; + display: -webkit-flex; + display: -ms-flexbox; + flex-shrink: 0; + -webkit-flex-shrink: 0; + -ms-flex: 1 0; +} +#resizer { + position: absolute; + right: -5px; + top: 0; + width: 10px; + height: 100%; + cursor: col-resize; + z-index: 9999; +} +#main { + flex: 5 1; + -webkit-flex: 5 1; + -ms-flex: 5 1; + outline: none; + position: relative; + background: #fff; + padding: 1.2em; + padding-top: 0.2em; + box-sizing: border-box; +} + +@media (max-width: 920px) { + .nav_wrap { width: 100%; top: 0; right: 0; overflow: visible; position: absolute; } + #resizer { display: none; } + #nav { + z-index: 9999; + background: #fff; + display: none; + position: absolute; + top: 40px; + right: 12px; + width: 500px; + max-width: 80%; + height: 80%; + overflow-y: scroll; + border: 1px solid #999; + border-collapse: collapse; + box-shadow: -7px 5px 25px #aaa; + border-radius: 2px; + } +} + +@media (min-width: 920px) { + body { height: 100%; overflow: hidden; } + #main { height: 100%; overflow: auto; } + #search { display: none; } +} + +#main img { max-width: 100%; } +h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } +h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } +h1.title { margin-bottom: 10px; } +h1.alphaindex { margin-top: 0; font-size: 22px; } +h2 { + padding: 0; + padding-bottom: 3px; + border-bottom: 1px #aaa solid; + font-size: 1.4em; + margin: 1.8em 0 0.5em; + position: relative; +} +h2 small { font-weight: normal; font-size: 0.7em; display: inline; position: absolute; right: 0; } +h2 small a { + display: block; + height: 20px; + border: 1px solid #aaa; + border-bottom: 0; + border-top-left-radius: 5px; + background: #f8f8f8; + position: relative; + padding: 2px 7px; +} +.clear { clear: both; } +.inline { display: inline; } +.inline p:first-child { display: inline; } +.docstring, .tags, #filecontents { font-size: 15px; line-height: 1.5145em; } +.docstring p > code, .docstring p > tt, .tags p > code, .tags p > tt { + color: #c7254e; background: #f9f2f4; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } +.docstring h1 { font-size: 1.2em; } +.docstring h2 { font-size: 1.1em; } +.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } +.summary_desc .object_link a, .docstring .object_link a { + font-family: monospace; font-size: 1.05em; + color: #05a; background: #EDF4FA; padding: 2px 4px; font-size: 1em; + border-radius: 4px; +} +.rdoc-term { padding-right: 25px; font-weight: bold; } +.rdoc-list p { margin: 0; padding: 0; margin-bottom: 4px; } +.summary_desc pre.code .object_link a, .docstring pre.code .object_link a { + padding: 0px; background: inherit; color: inherit; border-radius: inherit; +} + +/* style for */ +#filecontents table, .docstring table { border-collapse: collapse; } +#filecontents table th, #filecontents table td, +.docstring table th, .docstring table td { border: 1px solid #ccc; padding: 8px; padding-right: 17px; } +#filecontents table tr:nth-child(odd), +.docstring table tr:nth-child(odd) { background: #eee; } +#filecontents table tr:nth-child(even), +.docstring table tr:nth-child(even) { background: #fff; } +#filecontents table th, .docstring table th { background: #fff; } + +/* style for
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/api-doc/2.1.6/method_list.html b/api-doc/2.1.6/method_list.html new file mode 100644 index 0000000000..5a86f48cb3 --- /dev/null +++ b/api-doc/2.1.6/method_list.html @@ -0,0 +1,14947 @@ + + + + + + + + + + + + + + + + + + Method List + + + +
+
+

Method List

+ + + +
+ +
    + + +
  • +
    + #== + GraphQL::Query::Result +
    +
  • + + +
  • +
    + #== + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #== + GraphQL::Schema::Wrapper +
    +
  • + + +
  • +
    + #[] + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #[] + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #[] + GraphQL::Query::Context::ScopedContext +
    +
  • + + +
  • +
    + #[] + GraphQL::StaticValidation::DefinitionDependencies::DependencyMap +
    +
  • + + +
  • +
    + #[] + GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash +
    +
  • + + +
  • +
    + #[]= + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #[]= + GraphQL::Execution::Lazy::LazyMethodMap::ConcurrentishMap +
    +
  • + + +
  • +
    + #__schema + GraphQL::Introspection::EntryPoints +
    +
  • + + +
  • +
    + #__type + GraphQL::Introspection::EntryPoints +
    +
  • + + +
  • +
    + #__typename + GraphQL::Introspection::DynamicFields +
    +
  • + + +
  • +
    + #_reduce_none + GraphQL::Language::Parser +
    +
  • + + +
  • +
    + #abstract? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #abstract_type + GraphQL::Schema::TypeMembership +
    +
  • + + +
  • +
    + #add + GraphQL::Query::Context::ExecutionErrors +
    +
  • + + +
  • +
    + #add + GraphQL::Pagination::Connections +
    +
  • + + +
  • +
    + #add + GraphQL::Execution::Interpreter::ExecutionErrors +
    +
  • + + +
  • +
    + #add_argument + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + #add_conflict + GraphQL::StaticValidation::FieldsWillMergeError +
    +
  • + + +
  • +
    + add_directive + GraphQL::Schema::Member::HasDirectives +
    +
  • + + +
  • +
    + #add_error + GraphQL::Query::Context::SharedMethods +
    +
  • + + +
  • +
    + #add_field + GraphQL::Schema::Member::HasFields +
    +
  • + + +
  • +
    + add_page_info_field + GraphQL::Types::Relay::ConnectionBehaviors +
    +
  • + + +
  • +
    + #add_problem + GraphQL::Query::InputValidationResult +
    +
  • + + +
  • + +
  • + + +
  • +
    + #added_default_arguments + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #added_extras + GraphQL::Schema::Field::ExtendedState +
    +
  • + + +
  • +
    + #added_extras + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #after + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + after_any_lazies + GraphQL::Schema +
    +
  • + + +
  • +
    + #after_define + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #after_define_apply + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #after_lazy + GraphQL::Query +
    +
  • + + +
  • +
    + after_lazy + GraphQL::Schema +
    +
  • + + +
  • +
    + #after_lazy + GraphQL::Query::NullContext::NullQuery +
    +
  • + + +
  • +
    + #after_lazy + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #after_query + GraphQL::Subscriptions::Instrumentation +
    +
  • + + +
  • +
    + #after_resolve + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #after_resolve + GraphQL::Schema::Field::ScopeExtension +
    +
  • + + +
  • +
    + #after_resolve + GraphQL::Schema::Field::ConnectionExtension +
    +
  • + + +
  • +
    + #after_resolve + GraphQL::Subscriptions::DefaultSubscriptionResolveExtension +
    +
  • + + +
  • +
    + #after_value + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #alias_selection + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + all + GraphQL::Execution::Lazy +
    +
  • + + +
  • +
    + #all_argument_definitions + GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments +
    +
  • + + +
  • +
    + #all_argument_definitions + GraphQL::Schema::Member::HasArguments::FieldConfigured +
    +
  • + + +
  • +
    + #all_argument_definitions + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + all_enum_value_definitions + GraphQL::Schema::Enum +
    +
  • + + +
  • +
    + all_field_argument_definitions + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #all_field_argument_definitions + GraphQL::Schema::HasSingleInputArgument::ClassMethods +
    +
  • + + +
  • +
    + #all_field_definitions + GraphQL::Schema::Member::HasFields +
    +
  • + + +
  • +
    + all_possible_types + GraphQL::Schema::Union +
    +
  • + + +
  • +
    + all_validators + GraphQL::Schema::Validator +
    +
  • + + +
  • +
    + #all_wrappers + GraphQL::Pagination::Connections +
    +
  • + + +
  • +
    + analysis_engine + GraphQL::Schema +
    +
  • + + +
  • +
    + #analysis_errors + GraphQL::Query +
    +
  • + + +
  • +
    + analysis_errors + GraphQL::Analysis::AST +
    +
  • + + +
  • +
    + #analytics_available? + GraphQL::Tracing::DataDogTracing +
    +
  • + + +
  • +
    + #analytics_enabled? + GraphQL::Tracing::DataDogTracing +
    +
  • + + +
  • +
    + #analytics_sample_rate + GraphQL::Tracing::DataDogTracing +
    +
  • + + +
  • +
    + #analyze? + GraphQL::Analysis::AST::Analyzer +
    +
  • + + +
  • +
    + #analyze? + GraphQL::Subscriptions::BroadcastAnalyzer +
    +
  • + + +
  • +
    + analyze_multiplex + GraphQL::Analysis::AST +
    +
  • + + +
  • +
    + #analyze_multiplex + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #analyze_multiplex + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + analyze_query + GraphQL::Analysis::AST +
    +
  • + + +
  • +
    + #analyze_query + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #analyze_query + GraphQL::Backtrace::Trace +
    +
  • + + +
  • +
    + #analyze_query + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #analyzers + GraphQL::Query::ValidationPipeline +
    +
  • + + +
  • +
    + #any_arguments? + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + #any_arguments? + GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments +
    +
  • + + +
  • +
    + #any_arguments? + GraphQL::Schema::Member::HasArguments::FieldConfigured +
    +
  • + + +
  • +
    + any_field_arguments? + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #any_field_arguments? + GraphQL::Schema::HasSingleInputArgument::ClassMethods +
    +
  • + + +
  • +
    + #append + GraphQL::Language::Printer::TruncatableBuffer +
    +
  • + + +
  • +
    + #append_job + GraphQL::Dataloader +
    +
  • + + +
  • +
    + #append_job + GraphQL::Dataloader::NullDataloader +
    +
  • + + +
  • +
    + #apply + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #apply + GraphQL::Schema::Field::ConnectionExtension +
    +
  • + + +
  • +
    + #args + GraphQL::Introspection::FieldType +
    +
  • + + +
  • +
    + #args + GraphQL::Introspection::DirectiveType +
    +
  • + + +
  • +
    + argument + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + argument + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #argument + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + #argument + GraphQL::Schema::HasSingleInputArgument::ClassMethods +
    +
  • + + +
  • +
    + #argument + GraphQL::LoadApplicationObjectFailedError +
    +
  • + + +
  • +
    + #argument + GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError +
    +
  • + + +
  • +
    + #argument_class + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + #argument_class + GraphQL::Schema::Member::HasArguments::ArgumentClassAccessor +
    +
  • + + +
  • +
    + #argument_definition + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #argument_definition + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #argument_name + GraphQL::StaticValidation::ArgumentsAreDefinedError +
    +
  • + + +
  • +
    + #argument_name + GraphQL::StaticValidation::VariableUsagesAreAllowedError +
    +
  • + + +
  • +
    + #argument_name + GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError +
    +
  • + + +
  • +
    + #argument_name + GraphQL::StaticValidation::FragmentsAreOnCompositeTypesError +
    +
  • + + +
  • +
    + #argument_name + GraphQL::StaticValidation::RequiredInputObjectAttributesArePresentError +
    +
  • + + +
  • +
    + #argument_type + GraphQL::StaticValidation::RequiredInputObjectAttributesArePresentError +
    +
  • + + +
  • +
    + #argument_values + GraphQL::Execution::Interpreter::Arguments +
    +
  • + + +
  • +
    + #arguments + GraphQL::Backtrace::Frame +
    +
  • + + +
  • +
    + #arguments + GraphQL::Schema::Field::ExtendedState +
    +
  • + + +
  • +
    + arguments + GraphQL::Schema::Warden::PassThruWarden +
    +
  • + + +
  • +
    + #arguments + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #arguments + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #arguments + GraphQL::Language::Nodes::InputObject +
    +
  • + + +
  • +
    + #arguments + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #arguments + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #arguments + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #arguments + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #arguments + GraphQL::Subscriptions::Event +
    +
  • + + +
  • +
    + #arguments + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #arguments + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + #arguments + GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments +
    +
  • + + +
  • +
    + #arguments + GraphQL::Schema::Member::HasArguments::FieldConfigured +
    +
  • + + +
  • +
    + #arguments + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #arguments + GraphQL::StaticValidation::RequiredArgumentsArePresentError +
    +
  • + + +
  • +
    + #arguments_cache + GraphQL::Query +
    +
  • + + +
  • +
    + #arguments_for + GraphQL::Query +
    +
  • + + +
  • +
    + #arguments_for + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #arguments_statically_coercible? + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + #arguments_with_default_values + GraphQL::Schema::Addition +
    +
  • + + +
  • +
    + as_json + GraphQL::Schema +
    +
  • + + +
  • +
    + assign_type_membership_object_type + GraphQL::Schema::Union +
    +
  • + + +
  • +
    + #ast_node + GraphQL::Backtrace::Frame +
    +
  • + + +
  • +
    + #ast_node + GraphQL::ExecutionError +
    +
  • + + +
  • +
    + #ast_node + GraphQL::Schema::Member::HasAstNode +
    +
  • + + +
  • +
    + #ast_node + GraphQL::StaticValidation::VariablesAreUsedAndDefined::VariableUsage +
    +
  • + + +
  • +
    + #ast_nodes + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #authorize_application_object + GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader +
    +
  • + + +
  • +
    + #authorized + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #authorized + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #authorized + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #authorized + GraphQL::Tracing::AppOpticsTrace +
    +
  • + + +
  • +
    + #authorized? + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #authorized? + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #authorized? + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #authorized? + GraphQL::Schema::EnumValue +
    +
  • + + +
  • +
    + authorized? + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #authorized? + GraphQL::Types::Relay::EdgeBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #authorized? + GraphQL::Schema::Member::BaseDSLMethods +
    +
  • + + +
  • +
    + #authorized? + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #authorized_as_type? + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #authorized_lazy + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #authorized_lazy + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #authorized_lazy + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #authorized_lazy + GraphQL::Tracing::AppOpticsTrace +
    +
  • + + +
  • +
    + authorized_new + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + #authorized_span + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #backtrace + GraphQL::Query::Context::SharedMethods +
    +
  • + + +
  • +
    + batch_key_for + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #before + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #before_query + GraphQL::Subscriptions::Instrumentation +
    +
  • + + +
  • +
    + #before_value + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + broadcastable + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #broadcastable? + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #broadcastable? + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + broadcastable? + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #build_argument_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_argument_nodes + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + build_arguments + GraphQL::Schema::Loader +
    +
  • + + +
  • +
    + #build_default_value + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_definition_nodes + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_directive_location_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_directive_location_nodes + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_directive_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_directive_nodes + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_enum_type_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_enum_value_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_field_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_field_nodes + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + build_fields + GraphQL::Schema::Loader +
    +
  • + + +
  • +
    + #build_id + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + #build_input_object_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_interface_type_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_object_type_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_path + GraphQL::Execution::Interpreter::Runtime::GraphQLResult +
    +
  • + + +
  • +
    + #build_scalar_type_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_schema_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + build_trace_mode + GraphQL::Schema +
    +
  • + + +
  • +
    + build_type + GraphQL::Schema::TypeExpression +
    +
  • + + +
  • +
    + #build_type_definition_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_type_definition_nodes + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_type_name_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #build_union_type_node + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #calculate_complexity + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + call + GraphQL::Schema::NullMask +
    +
  • + + +
  • +
    + #call + GraphQL::Schema::IntrospectionSystem::PerFieldProxyResolve +
    +
  • + + +
  • +
    + call + GraphQL::Schema::BuildFromDefinition::ResolveMap::NullScalarCoerce +
    +
  • + + +
  • +
    + #call + GraphQL::Schema::BuildFromDefinition::ResolveMap +
    +
  • + + +
  • +
    + #call + GraphQL::Schema::BuildFromDefinition::ResolveMap::DefaultResolve +
    +
  • + + +
  • +
    + #call_method_on_directives + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + camelize + GraphQL::Schema::Member::BuildType +
    +
  • + + +
  • +
    + #children + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #children + GraphQL::Language::Nodes::Argument +
    +
  • + + +
  • +
    + #children_method_name + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + children_of_type + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #class_name + GraphQL::StaticValidation::RequiredArgumentsArePresentError +
    +
  • + + +
  • +
    + #clear_cache + GraphQL::Dataloader +
    +
  • + + +
  • +
    + #clear_cache + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::ValidationTimeoutError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::FieldsWillMergeError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::QueryRootExistsError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::FragmentsAreUsedError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::FragmentsAreNamedError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::FragmentTypesExistError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::FragmentsAreFiniteError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::MutationRootExistsError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::ArgumentsAreDefinedError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::DirectivesAreDefinedError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::SubscriptionRootExistsError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::ArgumentNamesAreUniqueError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::FragmentNamesAreUniqueError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::OperationNamesAreValidError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::VariableNamesAreUniqueError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::VariablesAreInputTypesError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::FieldsAreDefinedOnTypeError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::NoDefinitionsArePresentError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::VariableUsagesAreAllowedError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::FragmentSpreadsArePossibleError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::InputObjectNamesAreUniqueError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::OneOfInputObjectsAreValidError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::RequiredArgumentsArePresentError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::UniqueDirectivesPerLocationError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::VariablesAreUsedAndDefinedError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::FragmentsAreOnCompositeTypesError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::DirectivesAreInValidLocationsError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::FieldsHaveAppropriateSelectionsError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError +
    +
  • + + +
  • +
    + #code + GraphQL::StaticValidation::RequiredInputObjectAttributesArePresentError +
    +
  • + + +
  • +
    + #coerce_argument_value_to_list? + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #coerce_arguments + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Types::ID +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Types::Int +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Types::JSON +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Schema::Enum +
    +
  • + + +
  • +
    + #coerce_input + GraphQL::Schema::List +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Types::Float +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Types::String +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Schema::Scalar +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Types::BigInt +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Types::Boolean +
    +
  • + + +
  • +
    + #coerce_input + GraphQL::Schema::NonNull +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Types::ISO8601Date +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Types::ISO8601Duration +
    +
  • + + +
  • +
    + coerce_input + GraphQL::Types::ISO8601DateTime +
    +
  • + + +
  • +
    + #coerce_input + GraphQL::Schema::BuildFromDefinition::ResolveMap +
    +
  • + + +
  • +
    + #coerce_into_values + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #coerce_isolated_input + GraphQL::Schema::Member::ValidatesInput +
    +
  • + + +
  • +
    + #coerce_isolated_result + GraphQL::Schema::Member::ValidatesInput +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Types::ID +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Types::Int +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Types::JSON +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Schema::Enum +
    +
  • + + +
  • +
    + #coerce_result + GraphQL::Schema::List +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Types::Float +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Types::String +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Schema::Scalar +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Types::BigInt +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Types::Boolean +
    +
  • + + +
  • +
    + #coerce_result + GraphQL::Schema::NonNull +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Types::ISO8601Date +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Types::ISO8601Duration +
    +
  • + + +
  • +
    + coerce_result + GraphQL::Types::ISO8601DateTime +
    +
  • + + +
  • +
    + #coerce_result + GraphQL::Schema::BuildFromDefinition::ResolveMap +
    +
  • + + +
  • +
    + #col + GraphQL::ParseError +
    +
  • + + +
  • +
    + #col + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #col + GraphQL::Language::Token +
    +
  • + + +
  • +
    + #collect + GraphQL::Tracing::PrometheusTracing::GraphQLCollector +
    +
  • + + +
  • +
    + #column_type_string + Graphql::Generators::FieldExtractor +
    +
  • + + +
  • +
    + #complexity + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + complexity + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #composite? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #compute_if_absent + GraphQL::Execution::Lazy::LazyMethodMap::ConcurrentishMap +
    +
  • + + +
  • +
    + #conflicts + GraphQL::StaticValidation::FieldsWillMergeError +
    +
  • + + +
  • +
    + #connection + GraphQL::Relay::RangeAdd +
    +
  • + + +
  • +
    + #connection? + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + connection_extension + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #connection_type + GraphQL::Schema::Member::RelayShortcuts +
    +
  • + + +
  • +
    + #connection_type_class + GraphQL::Schema::Member::RelayShortcuts +
    +
  • + + +
  • +
    + connections + GraphQL::Schema +
    +
  • + + +
  • +
    + const_missing + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + constantize + GraphQL::Schema::Member::BuildType +
    +
  • + + +
  • +
    + #context + GraphQL::Query +
    +
  • + + +
  • +
    + #context + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + #context + GraphQL::Query::Variables +
    +
  • + + +
  • +
    + #context + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #context + GraphQL::UnauthorizedError +
    +
  • + + +
  • +
    + #context + GraphQL::Execution::Multiplex +
    +
  • + + +
  • +
    + #context + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #context + GraphQL::Subscriptions::Event +
    +
  • + + +
  • +
    + #context + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #context + GraphQL::Backtrace::TracedError +
    +
  • + + +
  • +
    + #context + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #context + GraphQL::StaticValidation::BaseVisitor +
    +
  • + + +
  • +
    + #context + GraphQL::LoadApplicationObjectFailedError +
    +
  • + + +
  • +
    + context_class + GraphQL::Schema +
    +
  • + + +
  • +
    + #continue_field + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #continue_value + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + count_introspection_fields + GraphQL::Schema +
    +
  • + + +
  • +
    + #create_dir + Graphql::Generators::Core +
    +
  • + + +
  • +
    + #create_folder_structure + Graphql::Generators::InstallGenerator +
    +
  • + + +
  • +
    + #create_loader_file + Graphql::Generators::LoaderGenerator +
    +
  • + + +
  • +
    + #create_mutation_file + Graphql::Generators::MutationGenerator +
    +
  • + + +
  • +
    + #create_mutation_file + Graphql::Generators::OrmMutationsBase +
    +
  • + + +
  • +
    + #create_type_file + Graphql::Generators::TypeGeneratorBase +
    +
  • + + +
  • +
    + #current_arguments + GraphQL::Execution::Interpreter::Runtime::CurrentState +
    +
  • + + +
  • +
    + #current_field + GraphQL::Execution::Interpreter::Runtime::CurrentState +
    +
  • + + +
  • +
    + #current_object + GraphQL::Execution::Interpreter::Runtime::CurrentState +
    +
  • + + +
  • +
    + #current_path + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #current_path + GraphQL::Query::Context::ScopedContext +
    +
  • + + +
  • +
    + #current_path + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #current_result + GraphQL::Execution::Interpreter::Runtime::CurrentState +
    +
  • + + +
  • +
    + #current_result_name + GraphQL::Execution::Interpreter::Runtime::CurrentState +
    +
  • + + +
  • +
    + #current_trace + GraphQL::Query +
    +
  • + + +
  • +
    + #current_trace + GraphQL::Execution::Multiplex +
    +
  • + + +
  • +
    + #cursor + GraphQL::Pagination::Connection::Edge +
    +
  • + + +
  • +
    + cursor_encoder + GraphQL::Schema +
    +
  • + + +
  • +
    + #cursor_for + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #cursor_for + GraphQL::Pagination::ArrayConnection +
    +
  • + + +
  • +
    + #cursor_for + GraphQL::Pagination::RelationConnection +
    +
  • + + +
  • +
    + #cyclical_definitions + GraphQL::StaticValidation::DefinitionDependencies::DependencyMap +
    +
  • + + +
  • +
    + #dataload_for + GraphQL::Execution::Interpreter::ArgumentsCache +
    +
  • + + +
  • +
    + #dataloader + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #dataloader + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + #dataloader + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #dataloader + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #dataloader + GraphQL::Query::NullContext +
    +
  • + + +
  • +
    + #dataloader + GraphQL::Execution::Multiplex +
    +
  • + + +
  • +
    + dataloader_class + GraphQL::Schema +
    +
  • + + +
  • +
    + #date_value + GraphQL::DateEncodingError +
    +
  • + + +
  • +
    + #dead_result? + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #declared? + GraphQL::StaticValidation::VariablesAreUsedAndDefined::VariableUsage +
    +
  • + + +
  • +
    + #declared_by + GraphQL::StaticValidation::VariablesAreUsedAndDefined::VariableUsage +
    +
  • + + +
  • +
    + decode + GraphQL::Schema::Base64Encoder +
    +
  • + + +
  • +
    + decode + GraphQL::Schema::UniqueWithinType +
    +
  • + + +
  • +
    + default_analysis_engine + GraphQL::Schema +
    +
  • + + +
  • +
    + default_argument + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + default_argument_configurations + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #default_broadcastable + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + default_directive + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + default_directive? + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + default_directives + GraphQL::Schema +
    +
  • + + +
  • +
    + default_execution_strategy + GraphQL::Schema +
    +
  • + + +
  • +
    + #default_global_id + GraphQL::Types::Relay::NodeBehaviors +
    +
  • + + +
  • +
    + default_graphql_name + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #default_graphql_name + GraphQL::Schema::Member::BaseDSLMethods +
    +
  • + + +
  • +
    + default_id_separator + GraphQL::Schema::UniqueWithinType +
    +
  • + + +
  • +
    + default_logger + GraphQL::Schema +
    +
  • + + +
  • +
    + default_max_page_size + GraphQL::Schema +
    +
  • + + +
  • +
    + default_nonblocking + GraphQL::Dataloader +
    +
  • + + +
  • +
    + default_page_size + GraphQL::Schema +
    +
  • + + +
  • +
    + #default_page_size + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + default_page_size + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #default_page_size + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #default_page_size= + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + default_parser + GraphQL +
    +
  • + + +
  • +
    + #default_relay + GraphQL::Schema::Member::BaseDSLMethods +
    +
  • + + +
  • +
    + #default_relay? + GraphQL::Types::Relay::EdgeBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #default_relay? + GraphQL::Types::Relay::NodeBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #default_relay? + GraphQL::Types::Relay::ClassMethods +
    +
  • + + +
  • +
    + #default_relay? + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + default_scalar + GraphQL::Schema::Scalar +
    +
  • + + +
  • +
    + default_scalar? + GraphQL::Schema::Scalar +
    +
  • + + +
  • +
    + default_trace_mode + GraphQL::Schema +
    +
  • + + +
  • +
    + #default_used? + GraphQL::Execution::Interpreter::ArgumentValue +
    +
  • + + +
  • +
    + #default_value + GraphQL::Language::Nodes::VariableDefinition +
    +
  • + + +
  • +
    + #default_value + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #default_value + GraphQL::Introspection::InputValueType +
    +
  • + + +
  • +
    + #default_value? + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #definition + GraphQL::Execution::Interpreter::ArgumentValue +
    +
  • + + +
  • +
    + #definition + GraphQL::StaticValidation::FieldsWillMerge::Field +
    +
  • + + +
  • +
    + #definition_line + GraphQL::Language::Nodes::AbstractNode::DefinitionNode +
    +
  • + + +
  • +
    + #definition_methods + GraphQL::Schema::Interface::DefinitionMethods +
    +
  • + + +
  • +
    + #definitions + GraphQL::Language::Nodes::Document +
    +
  • + + +
  • +
    + #delete + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #delete + GraphQL::Pagination::Connections +
    +
  • + + +
  • +
    + #delete + GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash +
    +
  • + + +
  • +
    + #delete_all_interpreter_context + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #delete_child + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #delete_subscription + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + #delete_subscription + GraphQL::Subscriptions::ActionCableSubscriptions +
    +
  • + + +
  • +
    + #deliver + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + #deliver + GraphQL::Subscriptions::ActionCableSubscriptions +
    +
  • + + +
  • +
    + #dependencies + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #dependencies + GraphQL::StaticValidation::DefinitionDependencies +
    +
  • + + +
  • +
    + #dependency_map + GraphQL::StaticValidation::DefinitionDependencies +
    +
  • + + +
  • +
    + deprecated_graphql_definition + GraphQL::Schema +
    +
  • + + +
  • +
    + #deprecation_reason + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #deprecation_reason + GraphQL::Schema::Member::HasDeprecationReason +
    +
  • + + +
  • +
    + #deprecation_reason= + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + description + GraphQL::Schema +
    +
  • + + +
  • +
    + #description + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #description + GraphQL::Schema::List +
    +
  • + + +
  • +
    + #description + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #description + GraphQL::Language::Nodes::DirectiveDefinition +
    +
  • + + +
  • +
    + #description + GraphQL::Language::Nodes::ScalarTypeDefinition +
    +
  • + + +
  • +
    + #description + GraphQL::Language::Nodes::InputValueDefinition +
    +
  • + + +
  • +
    + #description + GraphQL::Language::Nodes::FieldDefinition +
    +
  • + + +
  • +
    + #description + GraphQL::Language::Nodes::ObjectTypeDefinition +
    +
  • + + +
  • +
    + #description + GraphQL::Language::Nodes::InterfaceTypeDefinition +
    +
  • + + +
  • +
    + #description + GraphQL::Language::Nodes::UnionTypeDefinition +
    +
  • + + +
  • +
    + #description + GraphQL::Language::Nodes::EnumValueDefinition +
    +
  • + + +
  • +
    + #description + GraphQL::Language::Nodes::EnumTypeDefinition +
    +
  • + + +
  • +
    + #description + GraphQL::Language::Nodes::InputObjectTypeDefinition +
    +
  • + + +
  • +
    + #description + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #description + GraphQL::Schema::NonNull +
    +
  • + + +
  • +
    + #description + GraphQL::Schema::EnumValue +
    +
  • + + +
  • +
    + #description + GraphQL::Schema::Member::BaseDSLMethods +
    +
  • + + +
  • +
    + #dig + GraphQL::Dig +
    +
  • + + +
  • +
    + #dig + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #dig + GraphQL::Query::Context::ScopedContext +
    +
  • + + +
  • +
    + #dig_keys + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + directive + GraphQL::Schema +
    +
  • + + +
  • +
    + #directive + GraphQL::Schema::Member::HasDirectives +
    +
  • + + +
  • +
    + #directive_definition + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #directive_definition + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #directive_name + GraphQL::StaticValidation::DirectivesAreDefinedError +
    +
  • + + +
  • +
    + #directive_name + GraphQL::StaticValidation::UniqueDirectivesPerLocationError +
    +
  • + + +
  • +
    + directives + GraphQL::Schema +
    +
  • + + +
  • +
    + #directives + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #directives + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #directives + GraphQL::Schema::Addition +
    +
  • + + +
  • +
    + #directives + GraphQL::Introspection::SchemaType +
    +
  • + + +
  • +
    + #directives + GraphQL::Schema::Member::HasDirectives +
    +
  • + + +
  • +
    + #directives_include? + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #directory + GraphQL::RakeTask +
    +
  • + + +
  • +
    + disable_introspection_entry_points + GraphQL::Schema +
    +
  • + + +
  • +
    + disable_introspection_entry_points? + GraphQL::Schema +
    +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • + +
  • + + +
  • +
    + #document + GraphQL::Query +
    +
  • + + +
  • +
    + #document + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #dummy + GraphQL::Schema::HasSingleInputArgument::ClassMethods +
    +
  • + + +
  • +
    + dump + GraphQL::Subscriptions::Serialize +
    +
  • + + +
  • +
    + dump_recursive + GraphQL::Subscriptions::Serialize +
    +
  • + + +
  • +
    + #duplicated_name + GraphQL::Schema::DuplicateNamesError +
    +
  • + + +
  • +
    + #duration_value + GraphQL::DurationEncodingError +
    +
  • + + +
  • +
    + #dynamic_field + GraphQL::Schema::IntrospectionSystem +
    +
  • + + +
  • +
    + #dynamic_fields + GraphQL::Schema::IntrospectionSystem +
    +
  • + + +
  • +
    + #dynamic_introspection + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #each + GraphQL::Execution::Lazy::LazyMethodMap +
    +
  • + + +
  • +
    + #each + GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash +
    +
  • + + +
  • +
    + #edge + GraphQL::Relay::RangeAdd +
    +
  • + + +
  • +
    + #edge_class + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #edge_class + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #edge_class_for_field + GraphQL::Pagination::Connections +
    +
  • + + +
  • +
    + #edge_nodes + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #edge_nullable + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #edge_type + GraphQL::Schema::Member::RelayShortcuts +
    +
  • + + +
  • +
    + #edge_type + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #edge_type_class + GraphQL::Schema::Member::RelayShortcuts +
    +
  • + + +
  • +
    + #edges + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #edges + GraphQL::Types::Relay::ConnectionBehaviors +
    +
  • + + +
  • +
    + #edges_nullable + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #emit + GraphQL::Language::Lexer +
    +
  • + + +
  • +
    + #emit_block + GraphQL::Language::Lexer +
    +
  • + + +
  • +
    + #emit_string + GraphQL::Language::Lexer +
    +
  • + + +
  • +
    + #empty? + GraphQL::Execution::Interpreter::Arguments +
    +
  • + + +
  • +
    + enabled? + GraphQL::Schema::Directive::Feature +
    +
  • + + +
  • +
    + encode + GraphQL::Schema::Base64Encoder +
    +
  • + + +
  • +
    + encode + GraphQL::Schema::UniqueWithinType +
    +
  • + + +
  • +
    + #end_cursor + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #entry_point + GraphQL::Schema::IntrospectionSystem +
    +
  • + + +
  • +
    + #entry_points + GraphQL::Schema::IntrospectionSystem +
    +
  • + + +
  • +
    + #enum? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + enum_value_class + GraphQL::Schema::Enum +
    +
  • + + +
  • +
    + enum_values + GraphQL::Schema::Enum +
    +
  • + + +
  • +
    + #enum_values + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #enum_values + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #enum_values + GraphQL::Introspection::TypeType +
    +
  • + + +
  • +
    + #error + GraphQL::StaticValidation::Error::ErrorHelper +
    +
  • + + +
  • +
    + error_bubbling + GraphQL::Schema +
    +
  • + + +
  • +
    + error_handlers + GraphQL::Schema +
    +
  • + + +
  • +
    + #error_message + GraphQL::StaticValidation::VariableUsagesAreAllowedError +
    +
  • + + +
  • +
    + #errors + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #errors + GraphQL::Query::Variables +
    +
  • + + +
  • +
    + #errors + GraphQL::Schema::Validator::ValidationFailedError +
    +
  • + + +
  • +
    + #errors + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + #evaluate_selection + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #evaluate_selection_with_args + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #evaluate_selection_with_resolved_keyword_args + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #evaluate_selections + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + execute + GraphQL::Schema +
    +
  • + + +
  • +
    + #execute + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + #execute_all + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + #execute_all + GraphQL::Subscriptions::ActionCableSubscriptions +
    +
  • + + +
  • +
    + #execute_field + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #execute_field + GraphQL::Schema::Timeout::Trace +
    +
  • + + +
  • +
    + #execute_field + GraphQL::Backtrace::Trace +
    +
  • + + +
  • +
    + #execute_field + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #execute_field + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #execute_field + GraphQL::Tracing::AppOpticsTrace +
    +
  • + + +
  • +
    + #execute_field_lazy + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #execute_field_lazy + GraphQL::Backtrace::Trace +
    +
  • + + +
  • +
    + #execute_field_lazy + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #execute_field_lazy + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #execute_field_lazy + GraphQL::Tracing::AppOpticsTrace +
    +
  • + + +
  • +
    + #execute_field_span + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #execute_multiplex + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #execute_multiplex + GraphQL::Schema::Timeout::Trace +
    +
  • + + +
  • +
    + #execute_multiplex + GraphQL::Backtrace::Trace +
    +
  • + + +
  • +
    + #execute_multiplex + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #execute_query + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #execute_query + GraphQL::Backtrace::Trace +
    +
  • + + +
  • +
    + #execute_query + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #execute_query + GraphQL::Tracing::NewRelicTrace +
    +
  • + + +
  • +
    + #execute_query_lazy + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #execute_query_lazy + GraphQL::Backtrace::Trace +
    +
  • + + +
  • +
    + #execute_query_lazy + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #execute_update + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + #executed? + GraphQL::Query +
    +
  • + + +
  • +
    + #execution_errors + GraphQL::Query::Context::SharedMethods +
    +
  • + + +
  • +
    + #extension + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + extension + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #extensions + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #extensions + GraphQL::CoercionError +
    +
  • + + +
  • +
    + #extensions + GraphQL::ExecutionError +
    +
  • + + +
  • +
    + extensions + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #extras + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + extras + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + extras + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #fetch + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #fetch + GraphQL::Language::Cache +
    +
  • + + +
  • +
    + #fetch + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #fetch + GraphQL::Execution::Interpreter::ArgumentsCache +
    +
  • + + +
  • +
    + #fetch_extra + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #field + GraphQL::Backtrace::Frame +
    +
  • + + +
  • +
    + #field + GraphQL::Execution::Lazy +
    +
  • + + +
  • +
    + #field + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #field + GraphQL::InvalidNullError +
    +
  • + + +
  • +
    + #field + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #field + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #field + GraphQL::StringEncodingError +
    +
  • + + +
  • +
    + #field + GraphQL::UnresolvedTypeError +
    +
  • + + +
  • +
    + #field + GraphQL::IntegerEncodingError +
    +
  • + + +
  • +
    + #field + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #field + GraphQL::Schema::Member::HasFields +
    +
  • + + +
  • +
    + #field + GraphQL::UnauthorizedFieldError +
    +
  • + + +
  • +
    + field + GraphQL::Introspection::BaseObject +
    +
  • + + +
  • +
    + #field + GraphQL::Schema::Resolver::HasPayloadType +
    +
  • + + +
  • +
    + field_arguments + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #field_arguments + GraphQL::Schema::HasSingleInputArgument::ClassMethods +
    +
  • + + +
  • +
    + field_block + GraphQL::Types::Relay::HasNodeField +
    +
  • + + +
  • +
    + field_block + GraphQL::Types::Relay::HasNodesField +
    +
  • + + +
  • +
    + #field_class + GraphQL::Schema::Member::HasFields +
    +
  • + + +
  • +
    + #field_class + GraphQL::Schema::Resolver::HasPayloadType +
    +
  • + + +
  • +
    + #field_definition + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #field_definition + GraphQL::Analysis::AST::QueryComplexity::ScopedTypeComplexity +
    +
  • + + +
  • +
    + #field_definition + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #field_name + GraphQL::StaticValidation::FieldsWillMergeError +
    +
  • + + +
  • +
    + #field_name + GraphQL::StaticValidation::FieldsAreDefinedOnTypeError +
    +
  • + + +
  • +
    + field_options + GraphQL::Types::Relay::HasNodeField +
    +
  • + + +
  • +
    + field_options + GraphQL::Types::Relay::HasNodesField +
    +
  • + + +
  • +
    + #fields + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #fields + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #fields + GraphQL::Introspection::TypeType +
    +
  • + + +
  • +
    + #fields + GraphQL::Schema::Member::HasFields::InterfaceMethods +
    +
  • + + +
  • +
    + #fields + GraphQL::Schema::Member::HasFields::ObjectMethods +
    +
  • + + +
  • +
    + #fields + Graphql::Generators::FieldExtractor +
    +
  • + + +
  • +
    + #fields? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #filename + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #final_result + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + find + GraphQL::Schema +
    +
  • + + +
  • +
    + #find + GraphQL::Schema::Finder +
    +
  • + + +
  • +
    + find_definition_dependencies + GraphQL::Language::DefinitionSlice::DependencyVisitor +
    +
  • + + +
  • +
    + find_handler_for + GraphQL::Execution::Errors +
    +
  • + + +
  • +
    + #fingerprint + GraphQL::Query +
    +
  • + + +
  • +
    + #fingerprint + GraphQL::Subscriptions::Event +
    +
  • + + +
  • +
    + #first + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #first_value + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #fragment_name + GraphQL::StaticValidation::FragmentsAreUsedError +
    +
  • + + +
  • +
    + #fragment_name + GraphQL::StaticValidation::FragmentsAreFiniteError +
    +
  • + + +
  • +
    + #fragment_name + GraphQL::StaticValidation::FragmentNamesAreUniqueError +
    +
  • + + +
  • +
    + #fragment_name + GraphQL::StaticValidation::FragmentSpreadsArePossibleError +
    +
  • + + +
  • +
    + #fragments + GraphQL::Query +
    +
  • + + +
  • +
    + from_a + GraphQL::Language::Nodes::Field +
    +
  • + + +
  • +
    + from_a + GraphQL::Language::Nodes::FragmentDefinition +
    +
  • + + +
  • +
    + from_config + GraphQL::Schema::Validator +
    +
  • + + +
  • +
    + from_context + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + from_definition + GraphQL::Schema +
    +
  • + + +
  • +
    + from_definition + GraphQL::Schema::BuildFromDefinition +
    +
  • + + +
  • +
    + from_definition_path + GraphQL::Schema::BuildFromDefinition +
    +
  • + + +
  • +
    + from_document + GraphQL::Schema::BuildFromDefinition +
    +
  • + + +
  • +
    + from_introspection + GraphQL::Schema +
    +
  • + + +
  • +
    + from_options + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + from_problem + GraphQL::Query::InputValidationResult +
    +
  • + + +
  • +
    + #from_resolver? + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #gather_selections + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + generate + GraphQL::Query::Fingerprint +
    +
  • + + +
  • +
    + #generate + GraphQL::Language::Generation +
    +
  • + + +
  • +
    + #generate + Graphql::Generators::Install::MutationRootGenerator +
    +
  • + + +
  • +
    + #generate_column_string + Graphql::Generators::FieldExtractor +
    +
  • + + +
  • +
    + #get + GraphQL::Execution::Lazy::LazyMethodMap +
    +
  • + + +
  • +
    + #get_argument + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #get_argument + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #get_argument + GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments +
    +
  • + + +
  • +
    + #get_argument + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + #get_current_runtime_state + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + get_directives + GraphQL::Schema::Member::HasDirectives +
    +
  • + + +
  • +
    + #get_fiber_variables + GraphQL::Dataloader +
    +
  • + + +
  • +
    + get_field + GraphQL::Schema +
    +
  • + + +
  • +
    + #get_field + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #get_field + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #get_field + GraphQL::Schema::Member::HasFields::InterfaceMethods +
    +
  • + + +
  • +
    + #get_field + GraphQL::Schema::Member::HasFields::ObjectMethods +
    +
  • + + +
  • +
    + get_field_argument + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #get_field_argument + GraphQL::Schema::HasSingleInputArgument::ClassMethods +
    +
  • + + +
  • +
    + get_fields + GraphQL::Schema +
    +
  • + + +
  • +
    + #get_references_to + GraphQL::Schema::SubclassGetReferencesTo +
    +
  • + + +
  • +
    + get_type + GraphQL::Schema +
    +
  • + + +
  • +
    + #get_type + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #get_type + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #global_id_field + GraphQL::Schema::Member::HasFields +
    +
  • + + +
  • +
    + #graphql_backtrace + GraphQL::Backtrace::TracedError +
    +
  • + + +
  • +
    + #graphql_dead + GraphQL::Execution::Interpreter::Runtime::GraphQLResult +
    +
  • + + +
  • +
    + #graphql_is_non_null_in_parent + GraphQL::Execution::Interpreter::Runtime::GraphQLResult +
    +
  • + + +
  • +
    + #graphql_merged_into + GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash +
    +
  • + + +
  • +
    + #graphql_name + GraphQL::Schema::List +
    +
  • + + +
  • +
    + #graphql_name + GraphQL::Schema::NonNull +
    +
  • + + +
  • +
    + #graphql_name + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #graphql_name + GraphQL::Schema::EnumValue +
    +
  • + + +
  • +
    + #graphql_name + GraphQL::Schema::TypeMembership +
    +
  • + + +
  • +
    + #graphql_name + GraphQL::Schema::Member::BaseDSLMethods +
    +
  • + + +
  • +
    + #graphql_parent + GraphQL::Execution::Interpreter::Runtime::GraphQLResult +
    +
  • + + +
  • +
    + #graphql_result_data + GraphQL::Execution::Interpreter::Runtime::GraphQLResult +
    +
  • + + +
  • +
    + #graphql_result_name + GraphQL::Execution::Interpreter::Runtime::GraphQLResult +
    +
  • + + +
  • +
    + #graphql_skip_at + GraphQL::Execution::Interpreter::Runtime::GraphQLResultArray +
    +
  • + + +
  • +
    + #graphql_type + Graphql::Generators::TypeGeneratorBase +
    +
  • + + +
  • +
    + #handle_or_reraise + GraphQL::Query +
    +
  • + + +
  • +
    + handle_or_reraise + GraphQL::Schema +
    +
  • + + +
  • +
    + #handle_timeout + GraphQL::Schema::Timeout +
    +
  • + + +
  • +
    + #handle_timeout + GraphQL::StaticValidation::Validator +
    +
  • + + +
  • +
    + #has_default_page_size? + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + has_default_page_size? + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #has_default_page_size_override? + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #has_max_page_size? + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + has_max_page_size? + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #has_max_page_size_override? + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #has_next_page + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #has_next_page + GraphQL::Pagination::ArrayConnection +
    +
  • + + +
  • +
    + #has_next_page + GraphQL::Pagination::RelationConnection +
    +
  • + + +
  • +
    + #has_nodes_field + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #has_previous_page + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #has_previous_page + GraphQL::Pagination::ArrayConnection +
    +
  • + + +
  • +
    + #has_previous_page + GraphQL::Pagination::RelationConnection +
    +
  • + + +
  • +
    + #has_validated? + GraphQL::Query::ValidationPipeline +
    +
  • + + +
  • +
    + #hash_key + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #id + GraphQL::LoadApplicationObjectFailedError +
    +
  • + + +
  • +
    + id_from_object + GraphQL::Schema +
    +
  • + + +
  • +
    + #idl_outfile + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #implements + GraphQL::Schema::Member::HasInterfaces +
    +
  • + + +
  • +
    + include? + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + include? + GraphQL::Schema::Directive::Feature +
    +
  • + + +
  • +
    + include? + GraphQL::Execution::DirectiveChecks +
    +
  • + + +
  • +
    + #include_deprecated_args + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #include_is_one_of + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #include_is_repeatable + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #include_schema_description + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #include_specified_by_url + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #included + GraphQL::Schema::Interface::DefinitionMethods +
    +
  • + + +
  • +
    + including_rules + GraphQL::StaticValidation::BaseVisitor +
    +
  • + + +
  • +
    + inherited + GraphQL::Schema +
    +
  • + + +
  • +
    + inherited + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #inherited + GraphQL::Schema::Member::Scoped +
    +
  • + + +
  • +
    + #inherited + GraphQL::Schema::Member::HasAstNode +
    +
  • + + +
  • +
    + #inherited + GraphQL::Types::Relay::EdgeBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #inherited + GraphQL::Schema::Member::HasArguments::ClassConfigured +
    +
  • + + +
  • +
    + #inherited + GraphQL::Schema::Member::HasDirectives +
    +
  • + + +
  • +
    + #inherited + GraphQL::Schema::Member::HasInterfaces::ClassConfigured +
    +
  • + + +
  • +
    + #inherited + GraphQL::Schema::Member::HasValidators::ClassConfigured +
    +
  • + + +
  • +
    + #inherited + GraphQL::Schema::Member::BaseDSLMethods::ConfigurationExtension +
    +
  • + + +
  • +
    + #inherited + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #initialize + GraphQL::InvariantError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::OperationNameMissingError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::DuplicateNamesError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::UnresolvedLateBoundTypeError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Backtrace +
    +
  • + + +
  • +
    + #initialize + GraphQL::Backtrace::Frame +
    +
  • + + +
  • +
    + #initialize + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #initialize + GraphQL::Dataloader +
    +
  • + + +
  • +
    + #initialize + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #initialize + GraphQL::ParseError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Enum::UnresolvedValueError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Enum::MissingValuesError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::Result +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Field::ExtendedState +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::Context::ExecutionErrors +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::Context::Scoped +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Finder +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #initialize + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #initialize + GraphQL::CoercionError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Lazy +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::Cache +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::Lexer +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::Nodes::AbstractNode::DefinitionNode +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::Token +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Printer +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Timeout +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Timeout::Trace +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Timeout::TimeoutError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Wrapper +
    +
  • + + +
  • +
    + #initialize + GraphQL::Backtrace::Table +
    +
  • + + +
  • +
    + #initialize + GraphQL::ExecutionError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::Variables +
    +
  • + + +
  • +
    + #initialize + GraphQL::Relay::RangeAdd +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Addition +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Argument::InvalidDefaultValueError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::Printer::TruncatableBuffer +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Validator +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Validator::ValidationFailedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::EnumValue +
    +
  • + + +
  • +
    + #initialize + GraphQL::Dataloader::Request +
    +
  • + + +
  • +
    + #initialize + GraphQL::InvalidNameError +
    +
  • + + +
  • +
    + #initialize + GraphQL::InvalidNullError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::NullContext +
    +
  • + + +
  • +
    + #initialize + GraphQL::UnauthorizedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::DateEncodingError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Lookahead::NullLookahead +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Multiplex +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + #initialize + GraphQL::Subscriptions::Event +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::ScoutTrace +
    +
  • + + +
  • +
    + #initialize + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::StatsdTrace +
    +
  • + + +
  • +
    + #initialize + GraphQL::Analysis::AST::Analyzer +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::ListResultFailedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #initialize + GraphQL::Pagination::Connection::Edge +
    +
  • + + +
  • +
    + #initialize + GraphQL::StringEncodingError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::ScoutTracing +
    +
  • + + +
  • +
    + #initialize + GraphQL::UnresolvedTypeError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Backtrace::TracedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Dataloader::RequestAll +
    +
  • + + +
  • +
    + #initialize + GraphQL::IntegerDecodingError +
    +
  • + + +
  • +
    + #initialize + GraphQL::IntegerEncodingError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Pagination::Connections +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::LateBoundType +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::TypeMembership +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::PlatformTrace +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::PlatformTrace::BaseKeyCache +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::StatsdTracing +
    +
  • + + +
  • +
    + #initialize + GraphQL::DurationEncodingError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::StaticVisitor +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Directive::OneOf +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::Error +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::AppsignalTrace +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::NewRelicTrace +
    +
  • + + +
  • +
    + #initialize + GraphQL::Analysis::AST::FieldUsage +
    +
  • + + +
  • +
    + #initialize + GraphQL::Analysis::AST::QueryDepth +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Directive::Flagged +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::PlatformTracing +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::PrometheusTrace +
    +
  • + + +
  • +
    + #initialize + GraphQL::UnauthorizedFieldError +
    +
  • + + +
  • +
    + #initialize + Graphql::Generators::TypeGeneratorBase::NormalizedField +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::DefinitionSlice::DependencyVisitor +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::ValidationPipeline +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::AppsignalTracing +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::NewRelicTracing +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::PrometheusTracing +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::IntrospectionSystem +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::IntrospectionSystem::PerFieldProxyResolve +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::Validator +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::NotificationsTrace +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::Context::ScopedContext +
    +
  • + + +
  • +
    + #initialize + GraphQL::Analysis::AST::QueryComplexity +
    +
  • + + +
  • +
    + #initialize + GraphQL::Analysis::AST::QueryComplexity::ScopedTypeComplexity +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::Runtime::CurrentState +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::InputValidationResult +
    +
  • + + +
  • +
    + #initialize + GraphQL::Subscriptions::Instrumentation +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::NotificationsTracing +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Lazy::LazyMethodMap +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Lazy::LazyMethodMap::ConcurrentishMap +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::BaseVisitor +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::Arguments +
    +
  • + + +
  • +
    + #initialize + GraphQL::Query::VariableValidationError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Subscriptions::BroadcastAnalyzer +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Member::TypeSystemHelpers +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Validator::FormatValidator +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Validator::LengthValidator +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Validator::RequiredValidator +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::LiteralValidator +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::ArgumentValue +
    +
  • + + +
  • +
    + #initialize + GraphQL::LoadApplicationObjectFailedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Validator::ExclusionValidator +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Validator::InclusionValidator +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::ArgumentsCache +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Validator::AllowNullValidator +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::ExecutionErrors +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Validator::AllowBlankValidator +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::RawValue +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::Validator::NumericalityValidator +
    +
  • + + +
  • +
    + #initialize + GraphQL::Language::DocumentFromSchemaDefinition +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::BuildFromDefinition::ResolveMap +
    +
  • + + +
  • +
    + #initialize + GraphQL::Subscriptions::ActionCableSubscriptions +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::DefinitionDependencies +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::DefinitionDependencies::DependencyMap +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::DefinitionDependencies::NodeWithPath +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FieldsWillMerge +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::ValidationTimeoutError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::ActiveSupportNotificationsTrace +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::Runtime::GraphQLResult +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash +
    +
  • + + +
  • +
    + #initialize + GraphQL::Execution::Interpreter::Runtime::GraphQLResultArray +
    +
  • + + +
  • +
    + #initialize + GraphQL::Tracing::PrometheusTracing::GraphQLCollector +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::DirectivesAreDefined +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FieldsWillMergeError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::QueryRootExistsError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FragmentsAreUsedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FragmentNamesAreUnique +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FragmentsAreNamedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::OperationNamesAreValid +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FragmentTypesExistError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FragmentsAreFiniteError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::MutationRootExistsError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::NoDefinitionsArePresent +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::ArgumentsAreDefinedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::VariableUsagesAreAllowed +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::DirectivesAreDefinedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FragmentSpreadsArePossible +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FragmentSpreadsArePossible::FragmentSpread +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::SubscriptionRootExistsError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::VariablesAreUsedAndDefined +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::ArgumentNamesAreUniqueError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FragmentNamesAreUniqueError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::OperationNamesAreValidError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::VariableNamesAreUniqueError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::VariablesAreInputTypesError +
    +
  • + + +
  • +
    + #initialize + GraphQL::Schema::BuildFromDefinition::ResolveMap::DefaultResolve +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FieldsAreDefinedOnTypeError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::NoDefinitionsArePresentError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::VariableUsagesAreAllowedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FragmentSpreadsArePossibleError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::InputObjectNamesAreUniqueError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::OneOfInputObjectsAreValidError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::RequiredArgumentsArePresentError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::UniqueDirectivesPerLocationError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::VariablesAreUsedAndDefinedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FragmentsAreOnCompositeTypesError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::DirectivesAreInValidLocationsError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::FieldsHaveAppropriateSelectionsError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError +
    +
  • + + +
  • +
    + #initialize + GraphQL::StaticValidation::RequiredInputObjectAttributesArePresentError +
    +
  • + + +
  • +
    + #initialize_copy + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #initialize_copy + GraphQL::Execution::Lazy::LazyMethodMap +
    +
  • + + +
  • +
    + #initialize_copy + GraphQL::Execution::Lazy::LazyMethodMap::ConcurrentishMap +
    +
  • + + +
  • +
    + #initialize_node + GraphQL::Language::Nodes::Field +
    +
  • + + +
  • +
    + #initialize_node + GraphQL::Language::Nodes::FragmentDefinition +
    +
  • + + +
  • +
    + #input? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #input_fields + GraphQL::Introspection::TypeType +
    +
  • + + +
  • +
    + #input_object? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #input_object_class + GraphQL::Schema::HasSingleInputArgument::ClassMethods +
    +
  • + + +
  • +
    + #input_object_type + GraphQL::StaticValidation::OneOfInputObjectsAreValidError +
    +
  • + + +
  • +
    + #input_object_type + GraphQL::StaticValidation::RequiredInputObjectAttributesArePresentError +
    +
  • + + +
  • +
    + #input_type + GraphQL::Schema::HasSingleInputArgument::ClassMethods +
    +
  • + + +
  • +
    + #insert_root_type + Graphql::Generators::Core +
    +
  • + + +
  • +
    + #inspect + GraphQL::Query +
    +
  • + + +
  • +
    + #inspect + GraphQL::Backtrace +
    +
  • + + +
  • +
    + #inspect + GraphQL::Query::Result +
    +
  • + + +
  • +
    + #inspect + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #inspect + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #inspect + GraphQL::Language::Token +
    +
  • + + +
  • +
    + #inspect + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #inspect + GraphQL::Schema::NonNull +
    +
  • + + +
  • +
    + #inspect + GraphQL::Schema::EnumValue +
    +
  • + + +
  • +
    + inspect + GraphQL::InvalidNullError +
    +
  • + + +
  • +
    + #inspect + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #inspect + GraphQL::Execution::Lookahead::NullLookahead +
    +
  • + + +
  • +
    + #inspect + GraphQL::Schema::LateBoundType +
    +
  • + + +
  • +
    + #inspect + GraphQL::Schema::TypeMembership +
    +
  • + + +
  • +
    + #inspect + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #inspect + GraphQL::Execution::Interpreter::Arguments +
    +
  • + + +
  • +
    + inspect_result + GraphQL::Backtrace::InspectResult +
    +
  • + + +
  • +
    + inspect_truncated + GraphQL::Backtrace::InspectResult +
    +
  • + + +
  • +
    + install + GraphQL::Schema::Validator +
    +
  • + + +
  • +
    + #install_relay + Graphql::Generators::Relay +
    +
  • + + +
  • +
    + #install_relay + Graphql::Generators::RelayGenerator +
    +
  • + + +
  • +
    + instrument + GraphQL::Schema +
    +
  • + + +
  • +
    + instrumenters + GraphQL::Schema +
    +
  • + + +
  • +
    + #integer_value + GraphQL::IntegerDecodingError +
    +
  • + + +
  • +
    + #integer_value + GraphQL::IntegerEncodingError +
    +
  • + + +
  • +
    + #interface? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + interface_type_memberships + GraphQL::Schema::Warden::PassThruWarden +
    +
  • + + +
  • +
    + #interface_type_memberships + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #interface_type_memberships + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #interface_type_memberships + GraphQL::Schema::Member::HasInterfaces +
    +
  • + + +
  • +
    + #interface_type_memberships + GraphQL::Schema::Member::HasInterfaces::ClassConfigured::InheritedInterfaces +
    +
  • + + +
  • +
    + #interfaces + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #interfaces + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #interfaces + GraphQL::Introspection::TypeType +
    +
  • + + +
  • +
    + #interfaces + GraphQL::Schema::Member::HasInterfaces::ClassConfigured::InheritedInterfaces +
    +
  • + + +
  • +
    + #interfaces + GraphQL::Schema::Member::HasInterfaces +
    +
  • + + +
  • +
    + #interpreter? + GraphQL::Query +
    +
  • + + +
  • +
    + interpreter? + GraphQL::Schema +
    +
  • + + +
  • +
    + #interpreter? + GraphQL::Query::NullContext +
    +
  • + + +
  • +
    + introspection + GraphQL::Schema +
    +
  • + + +
  • +
    + #introspection + GraphQL::Schema::Member::BaseDSLMethods +
    +
  • + + +
  • +
    + #introspection? + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #introspection? + GraphQL::Schema::Member::BaseDSLMethods +
    +
  • + + +
  • +
    + introspection_system + GraphQL::Schema +
    +
  • + + +
  • +
    + #is_deprecated + GraphQL::Introspection::FieldType +
    +
  • + + +
  • +
    + #is_deprecated + GraphQL::Introspection::EnumValueType +
    +
  • + + +
  • +
    + #is_deprecated + GraphQL::Introspection::InputValueType +
    +
  • + + +
  • +
    + #is_one_of + GraphQL::Introspection::TypeType +
    +
  • + + +
  • +
    + #items + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #join_queues + GraphQL::Dataloader +
    +
  • + + +
  • +
    + #json_outfile + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #key? + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #key? + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #key? + GraphQL::Query::Context::ScopedContext +
    +
  • + + +
  • +
    + #key? + GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash +
    +
  • + + +
  • +
    + #keyword + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #keyword_arguments + GraphQL::Execution::Interpreter::Arguments +
    +
  • + + +
  • +
    + kind + GraphQL::Schema::Enum +
    +
  • + + +
  • +
    + #kind + GraphQL::Schema::List +
    +
  • + + +
  • +
    + kind + GraphQL::Schema::Union +
    +
  • + + +
  • +
    + kind + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + kind + GraphQL::Schema::Scalar +
    +
  • + + +
  • +
    + #kind + GraphQL::Schema::NonNull +
    +
  • + + +
  • +
    + #kind + GraphQL::Schema::Interface::DefinitionMethods +
    +
  • + + +
  • +
    + kind + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #kind + GraphQL::Introspection::TypeType +
    +
  • + + +
  • +
    + #kind + GraphQL::Schema::Member::TypeSystemHelpers +
    +
  • + + +
  • +
    + #kind + GraphQL::StaticValidation::FieldsWillMergeError +
    +
  • + + +
  • +
    + #klass + Graphql::Generators::FieldExtractor +
    +
  • + + +
  • +
    + #last + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #last_value + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + lazy? + GraphQL::Schema +
    +
  • + + +
  • +
    + #lazy? + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + lazy_method_name + GraphQL::Schema +
    +
  • + + +
  • +
    + lazy_resolve + GraphQL::Schema +
    +
  • + + +
  • +
    + #leaf? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #lex + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #lex + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #line + GraphQL::ParseError +
    +
  • + + +
  • +
    + #line + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #line + GraphQL::Language::Token +
    +
  • + + +
  • +
    + #line_and_column + GraphQL::Language::Token +
    +
  • + + +
  • +
    + #list? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #list? + GraphQL::Schema::List +
    +
  • + + +
  • +
    + #list? + GraphQL::Schema::NonNull +
    +
  • + + +
  • +
    + #list? + GraphQL::Schema::Member::TypeSystemHelpers +
    +
  • + + +
  • +
    + #load + GraphQL::Schema::Loader +
    +
  • + + +
  • +
    + #load + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #load + GraphQL::Dataloader::Request +
    +
  • + + +
  • +
    + #load + GraphQL::Dataloader::RequestAll +
    +
  • + + +
  • +
    + load + GraphQL::Subscriptions::Serialize +
    +
  • + + +
  • +
    + #load_action_cable_message + GraphQL::Subscriptions::ActionCableSubscriptions +
    +
  • + + +
  • +
    + #load_all + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #load_and_authorize_application_object + GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader +
    +
  • + + +
  • +
    + #load_and_authorize_value + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #load_application_object + GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader +
    +
  • + + +
  • +
    + #load_application_object_failed + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + #load_application_object_failed + GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader +
    +
  • + + +
  • +
    + #load_context + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #load_schema + GraphQL::RakeTask +
    +
  • + + +
  • +
    + loadable? + GraphQL::Schema::Warden::PassThruWarden +
    +
  • + + +
  • +
    + #loadable? + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #loadable? + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #loads + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + locations + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #logger + GraphQL::Query +
    +
  • + + +
  • +
    + #logger + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #lookahead + GraphQL::Query +
    +
  • + + +
  • +
    + make_visit_methods + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + make_visit_methods + GraphQL::Language::StaticVisitor +
    +
  • + + +
  • +
    + max_complexity + GraphQL::Schema +
    +
  • + + +
  • +
    + #max_complexity + GraphQL::Execution::Multiplex +
    +
  • + + +
  • +
    + #max_complexity + GraphQL::Query::ValidationPipeline +
    +
  • + + +
  • +
    + max_depth + GraphQL::Schema +
    +
  • + + +
  • +
    + #max_depth + GraphQL::Query::ValidationPipeline +
    +
  • + + +
  • +
    + #max_errors + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + #max_page_size + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + max_page_size + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #max_page_size + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #max_page_size= + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #max_seconds + GraphQL::Schema::Timeout +
    +
  • + + +
  • +
    + #memos + GraphQL::Schema::Field::ExtendedState +
    +
  • + + +
  • +
    + #merge + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #merge + GraphQL::Language::Nodes::FieldDefinition +
    +
  • + + +
  • +
    + #merge + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #merge! + GraphQL::Query::Context::Scoped +
    +
  • + + +
  • +
    + #merge! + GraphQL::Query::Context::ScopedContext +
    +
  • + + +
  • +
    + #merge_extras + GraphQL::Execution::Interpreter::Arguments +
    +
  • + + +
  • +
    + #merge_into + GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash +
    +
  • + + +
  • +
    + #merge_result! + GraphQL::Query::InputValidationResult +
    +
  • + + +
  • +
    + #merged_context + GraphQL::Query::Context::ScopedContext +
    +
  • + + +
  • +
    + #message + GraphQL::StaticValidation::Error +
    +
  • + + +
  • +
    + #message + GraphQL::StaticValidation::FieldsWillMergeError +
    +
  • + + +
  • +
    + #method_conflict_warning? + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #method_missing + GraphQL::Query::Result +
    +
  • + + +
  • +
    + #method_str + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #method_sym + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #metrics + GraphQL::Tracing::PrometheusTracing::GraphQLCollector +
    +
  • + + +
  • +
    + #minimal_after_lazy + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #module_namespacing_when_supported + Graphql::Generators::Core +
    +
  • + + +
  • +
    + #multiplex + GraphQL::Query +
    +
  • + + +
  • +
    + multiplex + GraphQL::Schema +
    +
  • + + +
  • +
    + multiplex_analyzer + GraphQL::Schema +
    +
  • + + +
  • +
    + multiplex_analyzers + GraphQL::Schema +
    +
  • + + +
  • +
    + mutation + GraphQL::Schema +
    +
  • + + +
  • +
    + #mutation + GraphQL::Schema::Member::BaseDSLMethods +
    +
  • + + +
  • +
    + #mutation? + GraphQL::Query +
    +
  • + + +
  • +
    + mutation_execution_strategy + GraphQL::Schema +
    +
  • + + +
  • +
    + #mutation_type + GraphQL::Introspection::SchemaType +
    +
  • + + +
  • +
    + #name + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #name + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #name + GraphQL::Language::Nodes::Argument +
    +
  • + + +
  • +
    + #name + GraphQL::Language::Nodes::FragmentDefinition +
    +
  • + + +
  • +
    + #name + GraphQL::Language::Nodes +
    +
  • + + +
  • +
    + #name + GraphQL::Language::Token +
    +
  • + + +
  • +
    + #name + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #name + GraphQL::InvalidNameError +
    +
  • + + +
  • +
    + #name + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #name + GraphQL::Subscriptions::Event +
    +
  • + + +
  • +
    + #name + GraphQL::Schema::LateBoundType +
    +
  • + + +
  • +
    + #name + GraphQL::Introspection::EnumValueType +
    +
  • + + +
  • +
    + #name + GraphQL::Schema::Member::BaseDSLMethods +
    +
  • + + +
  • +
    + #name + GraphQL::StaticValidation::FieldsWillMerge::FragmentSpread +
    +
  • + + +
  • +
    + #name + GraphQL::StaticValidation::ArgumentsAreDefinedError +
    +
  • + + +
  • +
    + #name + GraphQL::StaticValidation::ArgumentNamesAreUniqueError +
    +
  • + + +
  • +
    + #name + GraphQL::StaticValidation::InputObjectNamesAreUniqueError +
    +
  • + + +
  • +
    + #name + GraphQL::StaticValidation::RequiredArgumentsArePresentError +
    +
  • + + +
  • +
    + #name + GraphQL::StaticValidation::DirectivesAreInValidLocationsError +
    +
  • + + +
  • +
    + #namespace + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #namespace? + GraphQL::Query::Context +
    +
  • + + +
  • +
    + new_connections? + GraphQL::Schema +
    +
  • + + +
  • +
    + new_trace + GraphQL::Schema +
    +
  • + + +
  • +
    + #next_token + GraphQL::Language::Lexer::BadEncoding +
    +
  • + + +
  • +
    + #next_token + GraphQL::Language::Lexer +
    +
  • + + +
  • +
    + #node + GraphQL::Pagination::Connection::Edge +
    +
  • + + +
  • +
    + #node + GraphQL::Types::Relay::EdgeBehaviors +
    +
  • + + +
  • +
    + #node + GraphQL::StaticValidation::DefinitionDependencies::NodeWithPath +
    +
  • + + +
  • +
    + #node + GraphQL::StaticValidation::FieldsWillMerge::Field +
    +
  • + + +
  • +
    + #node + GraphQL::StaticValidation::FragmentSpreadsArePossible::FragmentSpread +
    +
  • + + +
  • +
    + #node_name + GraphQL::StaticValidation::FieldsHaveAppropriateSelectionsError +
    +
  • + + +
  • +
    + #node_nullable + GraphQL::Types::Relay::EdgeBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #node_nullable + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #node_type + GraphQL::Types::Relay::EdgeBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #node_type + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #nodes + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #nodes + GraphQL::StaticValidation::Error +
    +
  • + + +
  • +
    + #nodes + GraphQL::Pagination::ArrayConnection +
    +
  • + + +
  • +
    + #nodes + GraphQL::Analysis::AST::QueryComplexity::ScopedTypeComplexity +
    +
  • + + +
  • +
    + #nodes + GraphQL::Pagination::RelationConnection +
    +
  • + + +
  • +
    + #nodes + GraphQL::Types::Relay::ConnectionBehaviors +
    +
  • + + +
  • +
    + #nodes_field + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #non_null? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #non_null? + GraphQL::Schema::NonNull +
    +
  • + + +
  • +
    + #non_null? + GraphQL::Schema::LateBoundType +
    +
  • + + +
  • +
    + #non_null? + GraphQL::Schema::Member::TypeSystemHelpers +
    +
  • + + +
  • +
    + #nonblocking? + GraphQL::Dataloader +
    +
  • + + +
  • +
    + #normalize_name + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + normalize_type_expression + Graphql::Generators::TypeGeneratorBase +
    +
  • + + +
  • +
    + normalize_type_expression + Graphql::Generators::InputGenerator +
    +
  • + + +
  • +
    + normalize_type_expression + Graphql::Generators::ObjectGenerator +
    +
  • + + +
  • +
    + null + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #null_relation + GraphQL::Pagination::MongoidRelationConnection +
    +
  • + + +
  • +
    + #object + GraphQL::Backtrace::Frame +
    +
  • + + +
  • +
    + #object + GraphQL::Schema::Field::ExtendedState +
    +
  • + + +
  • +
    + #object + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + #object + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #object + GraphQL::UnauthorizedError +
    +
  • + + +
  • +
    + #object + GraphQL::LoadApplicationObjectFailedError +
    +
  • + + +
  • +
    + #object? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #object_class + GraphQL::Schema::Resolver::HasPayloadType +
    +
  • + + +
  • +
    + object_from_id + GraphQL::Schema +
    +
  • + + +
  • +
    + #object_from_id + GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader +
    +
  • + + +
  • +
    + #object_type + GraphQL::Schema::TypeMembership +
    +
  • + + +
  • +
    + #object_types + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #object_types + GraphQL::StaticValidation::BaseVisitor +
    +
  • + + +
  • +
    + #of_type + GraphQL::Schema::Wrapper +
    +
  • + + +
  • +
    + #of_type + GraphQL::Introspection::TypeType +
    +
  • + + +
  • +
    + #on_argument + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #on_argument + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #on_argument + GraphQL::StaticValidation::ArgumentsAreDefined +
    +
  • + + +
  • +
    + #on_argument + GraphQL::StaticValidation::VariableUsagesAreAllowed +
    +
  • + + +
  • +
    + #on_argument + GraphQL::StaticValidation::ArgumentLiteralsAreCompatible +
    +
  • + + +
  • +
    + #on_argument_children + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + #on_argument_children + GraphQL::Language::StaticVisitor +
    +
  • + + +
  • +
    + #on_dependency_resolve + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + #on_dependency_resolve_handlers + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + #on_directive + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #on_directive + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #on_directive + GraphQL::StaticValidation::DirectivesAreDefined +
    +
  • + + +
  • +
    + #on_directive + GraphQL::StaticValidation::ArgumentNamesAreUnique +
    +
  • + + +
  • +
    + #on_directive + GraphQL::StaticValidation::RequiredArgumentsArePresent +
    +
  • + + +
  • +
    + #on_directive + GraphQL::StaticValidation::DirectivesAreInValidLocations +
    +
  • + + +
  • +
    + #on_document + GraphQL::StaticValidation::DefinitionDependencies +
    +
  • + + +
  • +
    + #on_document + GraphQL::StaticValidation::FragmentsAreUsed +
    +
  • + + +
  • +
    + #on_document + GraphQL::StaticValidation::FragmentsAreFinite +
    +
  • + + +
  • +
    + #on_document + GraphQL::StaticValidation::FragmentNamesAreUnique +
    +
  • + + +
  • +
    + #on_document + GraphQL::StaticValidation::OperationNamesAreValid +
    +
  • + + +
  • +
    + #on_document + GraphQL::StaticValidation::NoDefinitionsArePresent +
    +
  • + + +
  • +
    + #on_document + GraphQL::StaticValidation::FragmentSpreadsArePossible +
    +
  • + + +
  • +
    + #on_document + GraphQL::StaticValidation::VariablesAreUsedAndDefined +
    +
  • + + +
  • +
    + #on_document_children + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + #on_document_children + GraphQL::Language::StaticVisitor +
    +
  • + + +
  • +
    + #on_enter_field + GraphQL::Analysis::AST::QueryDepth +
    +
  • + + +
  • +
    + #on_enter_field + GraphQL::Analysis::AST::QueryComplexity +
    +
  • + + +
  • +
    + #on_enter_field + GraphQL::Subscriptions::BroadcastAnalyzer +
    +
  • + + +
  • +
    + #on_field + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #on_field + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #on_field + GraphQL::StaticValidation::FieldsWillMerge +
    +
  • + + +
  • +
    + #on_field + GraphQL::StaticValidation::ArgumentNamesAreUnique +
    +
  • + + +
  • +
    + #on_field + GraphQL::StaticValidation::FieldsAreDefinedOnType +
    +
  • + + +
  • +
    + #on_field + GraphQL::StaticValidation::RequiredArgumentsArePresent +
    +
  • + + +
  • +
    + #on_field + GraphQL::StaticValidation::FieldsHaveAppropriateSelections +
    +
  • + + +
  • +
    + on_field? + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #on_field_children + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + #on_field_children + GraphQL::Language::StaticVisitor +
    +
  • + + +
  • +
    + on_fragment? + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #on_fragment_definition + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #on_fragment_definition + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #on_fragment_definition + GraphQL::StaticValidation::DefinitionDependencies +
    +
  • + + +
  • +
    + #on_fragment_definition + GraphQL::StaticValidation::FragmentsAreNamed +
    +
  • + + +
  • +
    + #on_fragment_definition + GraphQL::StaticValidation::FragmentTypesExist +
    +
  • + + +
  • +
    + #on_fragment_definition + GraphQL::StaticValidation::FragmentNamesAreUnique +
    +
  • + + +
  • +
    + #on_fragment_definition + GraphQL::StaticValidation::VariablesAreUsedAndDefined +
    +
  • + + +
  • +
    + #on_fragment_definition + GraphQL::StaticValidation::FragmentsAreOnCompositeTypes +
    +
  • + + +
  • +
    + #on_fragment_definition_children + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + #on_fragment_definition_children + GraphQL::Language::StaticVisitor +
    +
  • + + +
  • +
    + #on_fragment_spread + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #on_fragment_spread + GraphQL::Language::DefinitionSlice::DependencyVisitor +
    +
  • + + +
  • +
    + #on_fragment_spread + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #on_fragment_spread + GraphQL::StaticValidation::DefinitionDependencies +
    +
  • + + +
  • +
    + #on_fragment_spread + GraphQL::StaticValidation::FragmentSpreadsArePossible +
    +
  • + + +
  • +
    + #on_fragment_spread + GraphQL::StaticValidation::VariablesAreUsedAndDefined +
    +
  • + + +
  • +
    + #on_inline_fragment + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #on_inline_fragment + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #on_inline_fragment + GraphQL::StaticValidation::FragmentTypesExist +
    +
  • + + +
  • +
    + #on_inline_fragment + GraphQL::StaticValidation::FragmentSpreadsArePossible +
    +
  • + + +
  • +
    + #on_inline_fragment + GraphQL::StaticValidation::FragmentsAreOnCompositeTypes +
    +
  • + + +
  • +
    + #on_input_object + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #on_input_object + GraphQL::StaticValidation::InputObjectNamesAreUnique +
    +
  • + + +
  • +
    + #on_input_object + GraphQL::StaticValidation::OneOfInputObjectsAreValid +
    +
  • + + +
  • +
    + #on_input_object + GraphQL::StaticValidation::RequiredInputObjectAttributesArePresent +
    +
  • + + +
  • +
    + #on_invalid_node + GraphQL::StaticValidation::NoDefinitionsArePresent +
    +
  • + + +
  • +
    + #on_leave_field + GraphQL::Analysis::AST::FieldUsage +
    +
  • + + +
  • +
    + #on_leave_field + GraphQL::Analysis::AST::QueryDepth +
    +
  • + + +
  • +
    + #on_leave_field + GraphQL::Analysis::AST::QueryComplexity +
    +
  • + + +
  • +
    + on_operation? + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::DefinitionDependencies +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::FieldsWillMerge +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::QueryRootExists +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::MutationRootExists +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::SubscriptionRootExists +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::OperationNamesAreValid +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::VariableNamesAreUnique +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::VariableUsagesAreAllowed +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::VariablesAreUsedAndDefined +
    +
  • + + +
  • +
    + #on_operation_definition + GraphQL::StaticValidation::FieldsHaveAppropriateSelections +
    +
  • + + +
  • +
    + #on_operation_definition_children + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + #on_operation_definition_children + GraphQL::Language::StaticVisitor +
    +
  • + + +
  • +
    + #on_send + GraphQL::Rubocop::GraphQL::DefaultNullTrue +
    +
  • + + +
  • +
    + #on_send + GraphQL::Rubocop::GraphQL::DefaultRequiredTrue +
    +
  • + + +
  • +
    + #on_variable_definition + GraphQL::StaticValidation::VariablesAreInputTypes +
    +
  • + + +
  • +
    + #on_variable_definition + GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTyped +
    +
  • + + +
  • +
    + #on_variable_identifier + GraphQL::StaticValidation::VariablesAreUsedAndDefined +
    +
  • + + +
  • +
    + one_of + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + one_of? + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #one_of? + GraphQL::Schema::Directive::OneOf::IsOneOf +
    +
  • + + +
  • +
    + #operation_fingerprint + GraphQL::Query +
    +
  • + + +
  • +
    + #operation_name + GraphQL::Query +
    +
  • + + +
  • +
    + #operation_name + GraphQL::StaticValidation::OperationNamesAreValidError +
    +
  • + + +
  • +
    + #operation_type + GraphQL::Language::Nodes::OperationDefinition +
    +
  • + + +
  • +
    + #operations + GraphQL::Query +
    +
  • + + +
  • +
    + #options + GraphQL::ExecutionError +
    +
  • + + +
  • +
    + #options + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + #options + GraphQL::Schema::TypeMembership +
    +
  • + + +
  • +
    + #original_name + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + orphan_types + GraphQL::Schema +
    +
  • + + +
  • +
    + #orphan_types + GraphQL::Schema::Interface::DefinitionMethods +
    +
  • + + +
  • +
    + #own_arguments + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + #own_complexity + GraphQL::Analysis::AST::QueryComplexity::ScopedTypeComplexity +
    +
  • + + +
  • +
    + #own_field_arguments + GraphQL::Schema::HasSingleInputArgument::ClassMethods +
    +
  • + + +
  • +
    + #own_fields + GraphQL::Schema::Member::HasFields +
    +
  • + + +
  • +
    + #own_interface_type_memberships + GraphQL::Schema::Member::HasInterfaces +
    +
  • + + +
  • +
    + own_trace_modes + GraphQL::Schema +
    +
  • + + +
  • +
    + own_trace_modules + GraphQL::Schema +
    +
  • + + +
  • +
    + #owner + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #owner + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #owner + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #owner + GraphQL::Schema::EnumValue +
    +
  • + + +
  • +
    + #owner_type + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #owner_type + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #owner_type + GraphQL::StaticValidation::FieldsWillMerge::Field +
    +
  • + + +
  • +
    + #page_info + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #parent + GraphQL::Relay::RangeAdd +
    +
  • + + +
  • +
    + #parent + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #parent + GraphQL::Pagination::Connection::Edge +
    +
  • + + +
  • +
    + #parent + GraphQL::StaticValidation::ArgumentsAreDefinedError +
    +
  • + + +
  • +
    + parent_class + GraphQL::InvalidNullError +
    +
  • + + +
  • +
    + #parent_error? + GraphQL::InvalidNullError +
    +
  • + + +
  • +
    + #parent_frame + GraphQL::Backtrace::Frame +
    +
  • + + +
  • +
    + #parent_name + GraphQL::StaticValidation::FragmentSpreadsArePossibleError +
    +
  • + + +
  • +
    + #parent_type + GraphQL::InvalidNullError +
    +
  • + + +
  • +
    + #parent_type + GraphQL::UnresolvedTypeError +
    +
  • + + +
  • +
    + #parent_type + GraphQL::StaticValidation::FragmentSpreadsArePossible::FragmentSpread +
    +
  • + + +
  • +
    + #parent_type_definition + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #parent_type_definition + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + #parents + GraphQL::StaticValidation::FieldsWillMerge::Field +
    +
  • + + +
  • +
    + #parents + GraphQL::StaticValidation::FieldsWillMerge::FragmentSpread +
    +
  • + + +
  • +
    + parse + GraphQL +
    +
  • + + +
  • +
    + #parse + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #parse + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + parse_error + GraphQL::Schema +
    +
  • + + +
  • +
    + parse_file + GraphQL +
    +
  • + + +
  • +
    + parse_int + GraphQL::Types::BigInt +
    +
  • + + +
  • +
    + parse_type + GraphQL::Schema::Member::BuildType +
    +
  • + + +
  • +
    + parse_with_racc + GraphQL +
    +
  • + + +
  • +
    + #partial_format + GraphQL::Schema::Validator +
    +
  • + + +
  • +
    + #path + GraphQL::Backtrace::Frame +
    +
  • + + +
  • +
    + #path + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #path + GraphQL::ExecutionError +
    +
  • + + +
  • +
    + path + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #path + GraphQL::StringEncodingError +
    +
  • + + +
  • +
    + #path + GraphQL::IntegerEncodingError +
    +
  • + + +
  • +
    + #path + GraphQL::Schema::Member::HasPath +
    +
  • + + +
  • +
    + #path + GraphQL::Schema::TypeMembership +
    +
  • + + +
  • +
    + #path + GraphQL::StaticValidation::Error +
    +
  • + + +
  • +
    + #path + GraphQL::StaticValidation::BaseVisitor +
    +
  • + + +
  • +
    + #path + GraphQL::StaticValidation::DefinitionDependencies::NodeWithPath +
    +
  • + + +
  • +
    + #path + GraphQL::Execution::Interpreter::Runtime::GraphQLResult +
    +
  • + + +
  • +
    + #path + GraphQL::StaticValidation::FieldsWillMergeError +
    +
  • + + +
  • +
    + #path + GraphQL::StaticValidation::FragmentSpreadsArePossible::FragmentSpread +
    +
  • + + +
  • +
    + #path + GraphQL::StaticValidation::VariablesAreUsedAndDefined::VariableUsage +
    +
  • + + +
  • +
    + #payload_type + GraphQL::Schema::Resolver::HasPayloadType +
    +
  • + + +
  • +
    + #pending + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #pending? + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #permitted_empty_value? + GraphQL::Schema::Validator +
    +
  • + + +
  • +
    + #platform_authorized + GraphQL::Tracing::ScoutTrace +
    +
  • + + +
  • +
    + #platform_authorized + GraphQL::Tracing::StatsdTrace +
    +
  • + + +
  • +
    + #platform_authorized + GraphQL::Tracing::AppsignalTrace +
    +
  • + + +
  • +
    + #platform_authorized + GraphQL::Tracing::NewRelicTrace +
    +
  • + + +
  • +
    + #platform_authorized + GraphQL::Tracing::PrometheusTrace +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::ScoutTrace +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::StatsdTrace +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::ScoutTracing +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::StatsdTracing +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::AppOpticsTrace +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::AppsignalTrace +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::NewRelicTrace +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::DataDogTracing +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::PrometheusTrace +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::AppOpticsTracing +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::AppsignalTracing +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::NewRelicTracing +
    +
  • + + +
  • +
    + #platform_authorized_key + GraphQL::Tracing::PrometheusTracing +
    +
  • + + +
  • +
    + #platform_authorized_key_cache + GraphQL::Tracing::PlatformTrace::BaseKeyCache +
    +
  • + + +
  • +
    + #platform_authorized_lazy + GraphQL::Tracing::PlatformTrace +
    +
  • + + +
  • +
    + #platform_authorized_lazy + GraphQL::Tracing::PrometheusTrace +
    +
  • + + +
  • +
    + #platform_execute_field + GraphQL::Tracing::ScoutTrace +
    +
  • + + +
  • +
    + #platform_execute_field + GraphQL::Tracing::StatsdTrace +
    +
  • + + +
  • +
    + #platform_execute_field + GraphQL::Tracing::AppsignalTrace +
    +
  • + + +
  • +
    + #platform_execute_field + GraphQL::Tracing::NewRelicTrace +
    +
  • + + +
  • +
    + #platform_execute_field + GraphQL::Tracing::PrometheusTrace +
    +
  • + + +
  • +
    + #platform_execute_field_lazy + GraphQL::Tracing::PlatformTrace +
    +
  • + + +
  • +
    + #platform_execute_field_lazy + GraphQL::Tracing::PrometheusTrace +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::ScoutTrace +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::StatsdTrace +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::ScoutTracing +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::StatsdTracing +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::AppOpticsTrace +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::AppsignalTrace +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::NewRelicTrace +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::DataDogTracing +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::PrometheusTrace +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::AppOpticsTracing +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::AppsignalTracing +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::NewRelicTracing +
    +
  • + + +
  • +
    + #platform_field_key + GraphQL::Tracing::PrometheusTracing +
    +
  • + + +
  • +
    + #platform_field_key_cache + GraphQL::Tracing::PlatformTrace::BaseKeyCache +
    +
  • + + +
  • +
    + platform_keys + GraphQL::Tracing::PlatformTracing +
    +
  • + + +
  • +
    + #platform_resolve_type + GraphQL::Tracing::AppsignalTrace +
    +
  • + + +
  • +
    + #platform_resolve_type + GraphQL::Tracing::NewRelicTrace +
    +
  • + + +
  • +
    + #platform_resolve_type + GraphQL::Tracing::PrometheusTrace +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::ScoutTrace +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::StatsdTrace +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::ScoutTracing +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::StatsdTracing +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::AppOpticsTrace +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::AppsignalTrace +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::NewRelicTrace +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::DataDogTracing +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::PrometheusTrace +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::AppOpticsTracing +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::AppsignalTracing +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::NewRelicTracing +
    +
  • + + +
  • +
    + #platform_resolve_type_key + GraphQL::Tracing::PrometheusTracing +
    +
  • + + +
  • +
    + #platform_resolve_type_key_cache + GraphQL::Tracing::PlatformTrace::BaseKeyCache +
    +
  • + + +
  • +
    + #platform_resolve_type_lazy + GraphQL::Tracing::PlatformTrace +
    +
  • + + +
  • +
    + #platform_resolve_type_lazy + GraphQL::Tracing::PrometheusTrace +
    +
  • + + +
  • +
    + #platform_trace + GraphQL::Tracing::ScoutTracing +
    +
  • + + +
  • +
    + #platform_trace + GraphQL::Tracing::StatsdTracing +
    +
  • + + +
  • +
    + #platform_trace + GraphQL::Tracing::DataDogTracing +
    +
  • + + +
  • +
    + #platform_trace + GraphQL::Tracing::AppOpticsTracing +
    +
  • + + +
  • +
    + #platform_trace + GraphQL::Tracing::AppsignalTracing +
    +
  • + + +
  • +
    + #platform_trace + GraphQL::Tracing::NewRelicTracing +
    +
  • + + +
  • +
    + #platform_trace + GraphQL::Tracing::PrometheusTracing +
    +
  • + + +
  • +
    + plugins + GraphQL::Schema +
    +
  • + + +
  • +
    + #position + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + possible_types + GraphQL::Schema +
    +
  • + + +
  • +
    + possible_types + GraphQL::Schema::Union +
    +
  • + + +
  • +
    + #possible_types + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #possible_types + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #possible_types + GraphQL::Schema::Addition +
    +
  • + + +
  • +
    + #possible_types + GraphQL::UnresolvedTypeError +
    +
  • + + +
  • +
    + #possible_types + GraphQL::Introspection::TypeType +
    +
  • + + +
  • +
    + #possible_types + GraphQL::Schema::IntrospectionSystem +
    +
  • + + +
  • +
    + #prepare + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #prepare + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #prepare_span + GraphQL::Tracing::DataDogTracing +
    +
  • + + +
  • +
    + #prepare_value + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #prev_token + GraphQL::Language::Token +
    +
  • + + +
  • +
    + #previous_argument_definition + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #previous_field_definition + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #print + GraphQL::Language::Printer +
    +
  • + + +
  • +
    + print + GraphQL::Language::BlockString +
    +
  • + + +
  • +
    + #print_argument + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #print_directive + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #print_field + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #print_fragment_definition + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #print_inline_fragment + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + print_introspection_schema + GraphQL::Schema::Printer +
    +
  • + + +
  • +
    + #print_node + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #print_operation_definition + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + print_schema + GraphQL::Schema::Printer +
    +
  • + + +
  • +
    + #print_schema + GraphQL::Schema::Printer +
    +
  • + + +
  • +
    + #print_schema_definition + GraphQL::Schema::Printer::IntrospectionPrinter +
    +
  • + + +
  • +
    + #print_type + GraphQL::Schema::Printer +
    +
  • + + +
  • +
    + #print_variable_identifier + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #problems + GraphQL::Query::InputValidationResult +
    +
  • + + +
  • +
    + #provided_variables + GraphQL::Query +
    +
  • + + +
  • +
    + #queries + GraphQL::Execution::Multiplex +
    +
  • + + +
  • +
    + query + GraphQL::Schema +
    +
  • + + +
  • +
    + #query + GraphQL::Backtrace::Frame +
    +
  • + + +
  • +
    + #query + GraphQL::ParseError +
    +
  • + + +
  • +
    + #query + GraphQL::Query::Result +
    +
  • + + +
  • +
    + query + GraphQL::Introspection +
    +
  • + + +
  • +
    + #query + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #query + GraphQL::Query::NullContext +
    +
  • + + +
  • +
    + #query + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #query + GraphQL::Analysis::AST::QueryComplexity::ScopedTypeComplexity +
    +
  • + + +
  • +
    + #query + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #query + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + #query? + GraphQL::Query +
    +
  • + + +
  • +
    + query_analyzer + GraphQL::Schema +
    +
  • + + +
  • +
    + query_analyzers + GraphQL::Schema +
    +
  • + + +
  • +
    + query_execution_strategy + GraphQL::Schema +
    +
  • + + +
  • +
    + query_stack_error + GraphQL::Schema +
    +
  • + + +
  • +
    + #query_string + GraphQL::Query +
    +
  • + + +
  • +
    + #query_type + GraphQL::Introspection::SchemaType +
    +
  • + + +
  • +
    + #rake_namespace + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #range_add_edge + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #raw_value + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + #reachable_type? + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #reachable_type? + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #reachable_types + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #reachable_types + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #read_subscription + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + #read_subscription + GraphQL::Subscriptions::ActionCableSubscriptions +
    +
  • + + +
  • +
    + #ready? + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #reauthorize_scoped_objects + GraphQL::Schema::Member::Scoped +
    +
  • + + +
  • +
    + #record_comment + GraphQL::Language::Lexer +
    +
  • + + +
  • +
    + #redact_argument_value? + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #redacted_argument_value + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #references + GraphQL::Schema::Addition +
    +
  • + + +
  • +
    + references_to + GraphQL::Schema +
    +
  • + + +
  • +
    + register_rescue_from + GraphQL::Execution::Errors +
    +
  • + + +
  • +
    + #relation_count + GraphQL::Pagination::MongoidRelationConnection +
    +
  • + + +
  • +
    + #relation_limit + GraphQL::Pagination::MongoidRelationConnection +
    +
  • + + +
  • +
    + #relation_offset + GraphQL::Pagination::MongoidRelationConnection +
    +
  • + + +
  • +
    + #relay_node_field + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #relay_nodes_field + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #remove_argument + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + #remove_directive + GraphQL::Schema::Member::HasDirectives +
    +
  • + + +
  • +
    + remove_directive + GraphQL::Schema::Member::HasDirectives +
    +
  • + + +
  • +
    + repeatable + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + repeatable? + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #replace_child + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + replace_escaped_characters_in_place + GraphQL::Language::Lexer +
    +
  • + + +
  • +
    + #replace_null_with_default? + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #request + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #request_all + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + rescue_from + GraphQL::Schema +
    +
  • + + +
  • +
    + #rescued_errors + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #resolve + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #resolve + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + resolve + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + #resolve + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + #resolve + GraphQL::Schema::FieldExtension +
    +
  • + + +
  • +
    + resolve + GraphQL::Schema::Directive::Transform +
    +
  • + + +
  • +
    + resolve + GraphQL::Execution::Interpreter::Resolve +
    +
  • + + +
  • +
    + #resolve + GraphQL::Schema::Field::ConnectionExtension +
    +
  • + + +
  • +
    + #resolve + GraphQL::Execution::Interpreter::RawValue +
    +
  • + + +
  • +
    + #resolve + GraphQL::Subscriptions::DefaultSubscriptionResolveExtension +
    +
  • + + +
  • +
    + resolve_all + GraphQL::Execution::Interpreter::Resolve +
    +
  • + + +
  • +
    + resolve_each + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + resolve_each_depth + GraphQL::Execution::Interpreter::Resolve +
    +
  • + + +
  • +
    + #resolve_late_bindings + GraphQL::Schema::IntrospectionSystem +
    +
  • + + +
  • +
    + #resolve_list_item + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + resolve_method + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #resolve_subscribe + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + #resolve_type + GraphQL::Query +
    +
  • + + +
  • +
    + #resolve_type + GraphQL::Schema::ResolveTypeWithType +
    +
  • + + +
  • +
    + resolve_type + GraphQL::Schema +
    +
  • + + +
  • +
    + #resolve_type + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #resolve_type + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #resolve_type + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #resolve_type + GraphQL::Tracing::AppOpticsTrace +
    +
  • + + +
  • +
    + #resolve_type + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #resolve_type_lazy + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #resolve_type_lazy + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #resolve_type_lazy + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #resolve_type_lazy + GraphQL::Tracing::AppOpticsTrace +
    +
  • + + +
  • +
    + #resolve_type_span + GraphQL::Tracing::DataDogTrace +
    +
  • + + +
  • +
    + #resolve_update + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + #resolve_with_support + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #resolve_with_support + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + #resolve_with_support + GraphQL::Schema::RelayClassicMutation +
    +
  • + + +
  • +
    + #resolve_with_support + GraphQL::Schema::HasSingleInputArgument +
    +
  • + + +
  • +
    + #resolved_type + GraphQL::UnresolvedTypeError +
    +
  • + + +
  • +
    + #resolver + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #resolver_method + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + resolver_method + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #resolves? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #respond_to_missing? + GraphQL::Query::Result +
    +
  • + + +
  • +
    + #response_extensions + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #response_path + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #response_path + GraphQL::Analysis::AST::QueryComplexity::ScopedTypeComplexity +
    +
  • + + +
  • +
    + #result + GraphQL::Query +
    +
  • + + +
  • +
    + #result + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + #result + GraphQL::Analysis::AST::Analyzer +
    +
  • + + +
  • +
    + #result + GraphQL::Analysis::AST::FieldUsage +
    +
  • + + +
  • +
    + #result + GraphQL::Analysis::AST::QueryDepth +
    +
  • + + +
  • +
    + #result + GraphQL::Analysis::AST::MaxQueryDepth +
    +
  • + + +
  • +
    + #result + GraphQL::Analysis::AST::QueryComplexity +
    +
  • + + +
  • +
    + #result + GraphQL::Subscriptions::BroadcastAnalyzer +
    +
  • + + +
  • +
    + #result + GraphQL::Analysis::AST::MaxQueryComplexity +
    +
  • + + +
  • +
    + #result_key_for + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #result_values + GraphQL::Query +
    +
  • + + +
  • +
    + root_type_for_operation + GraphQL::Schema +
    +
  • + + +
  • +
    + #root_type_for_operation + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #root_type_for_operation + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + root_types + GraphQL::Schema +
    +
  • + + +
  • +
    + #root_value + GraphQL::Query +
    +
  • + + +
  • +
    + #ruby2_keywords + GraphQL::Ruby2Keywords +
    +
  • + + +
  • +
    + #run + GraphQL::Dataloader +
    +
  • + + +
  • +
    + #run + GraphQL::Dataloader::NullDataloader +
    +
  • + + +
  • +
    + run_all + GraphQL::Execution::Interpreter +
    +
  • + + +
  • +
    + #run_directive + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #run_eager + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #run_isolated + GraphQL::Dataloader +
    +
  • + + +
  • +
    + #run_isolated + GraphQL::Dataloader::NullDataloader +
    +
  • + + +
  • +
    + #run_pending_keys + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + sanitized_printer + GraphQL::Schema +
    +
  • + + +
  • +
    + #sanitized_query_string + GraphQL::Query +
    +
  • + + +
  • +
    + #sanitized_query_string + GraphQL::Language::SanitizedPrinter +
    +
  • + + +
  • +
    + #scalar? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #scalars + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + scan + GraphQL +
    +
  • + + +
  • +
    + scan_with_ruby + GraphQL +
    +
  • + + +
  • +
    + #scanner + GraphQL::Language::Lexer::BadEncoding +
    +
  • + + +
  • +
    + #schema + GraphQL::Query +
    +
  • + + +
  • +
    + #schema + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #schema + GraphQL::Schema::Printer +
    +
  • + + +
  • +
    + #schema + GraphQL::Query::NullContext +
    +
  • + + +
  • +
    + #schema + GraphQL::Execution::Multiplex +
    +
  • + + +
  • +
    + #schema + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #schema + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + #schema_description + GraphQL::Introspection::SchemaType +
    +
  • + + +
  • +
    + schema_directive + GraphQL::Schema +
    +
  • + + +
  • +
    + schema_directives + GraphQL::Schema +
    +
  • + + +
  • +
    + #schema_directives + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + #schema_file_path + Graphql::Generators::Core +
    +
  • + + +
  • +
    + #schema_name + GraphQL::RakeTask +
    +
  • + + +
  • +
    + #scope_items + GraphQL::Schema::Member::Scoped +
    +
  • + + +
  • +
    + #scope_items + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #scoped + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #scoped? + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #scoped_children + GraphQL::Analysis::AST::QueryComplexity::ScopedTypeComplexity +
    +
  • + + +
  • +
    + #scoped_context + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #scoped_merge! + GraphQL::Query::Context +
    +
  • + + +
  • +
    + scoped_new + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + #scoped_set! + GraphQL::Query::Context +
    +
  • + + +
  • +
    + seconds_precision + GraphQL::Types::ISO8601Duration +
    +
  • + + +
  • +
    + seconds_precision= + GraphQL::Types::ISO8601Duration +
    +
  • + + +
  • +
    + #selected? + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #selected? + GraphQL::Execution::Lookahead::NullLookahead +
    +
  • + + +
  • +
    + #selected_operation + GraphQL::Query +
    +
  • + + +
  • +
    + #selected_operation_name + GraphQL::Query +
    +
  • + + +
  • +
    + #selection + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #selection + GraphQL::Execution::Lookahead::NullLookahead +
    +
  • + + +
  • +
    + #selections + GraphQL::Language::Nodes::Field +
    +
  • + + +
  • +
    + #selections + GraphQL::Language::Nodes::OperationDefinition +
    +
  • + + +
  • +
    + #selections + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #selections + GraphQL::Execution::Lookahead::NullLookahead +
    +
  • + + +
  • +
    + #selects? + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + #selects? + GraphQL::Execution::Lookahead::NullLookahead +
    +
  • + + +
  • +
    + #selects_alias? + GraphQL::Execution::Lookahead +
    +
  • + + +
  • +
    + serialize + GraphQL::Language +
    +
  • + + +
  • +
    + serialize + GraphQL::Subscriptions::Event +
    +
  • + + +
  • +
    + #service_name + GraphQL::Tracing::DataDogTracing +
    +
  • + + +
  • +
    + #set + GraphQL::Execution::Lazy::LazyMethodMap +
    +
  • + + +
  • +
    + #set! + GraphQL::Query::Context::Scoped +
    +
  • + + +
  • +
    + #set_child_result + GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash +
    +
  • + + +
  • +
    + #set_child_result + GraphQL::Execution::Interpreter::Runtime::GraphQLResultArray +
    +
  • + + +
  • +
    + #set_fiber_variables + GraphQL::Dataloader +
    +
  • + + +
  • +
    + #set_graphql_dead + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #set_leaf + GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash +
    +
  • + + +
  • +
    + #set_leaf + GraphQL::Execution::Interpreter::Runtime::GraphQLResultArray +
    +
  • + + +
  • +
    + #set_result + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #setup + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + #setup_stream + GraphQL::Subscriptions::ActionCableSubscriptions +
    +
  • + + +
  • +
    + #skip + GraphQL::Query::Context::SharedMethods +
    +
  • + + +
  • +
    + #skipping? + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #slice + GraphQL::Language::DefinitionSlice +
    +
  • + + +
  • +
    + #slice_definition + GraphQL::Language::Nodes::Document +
    +
  • + + +
  • +
    + #source_without_keyword_argument + GraphQL::Rubocop::GraphQL::BaseCop +
    +
  • + + +
  • +
    + specified_by_url + GraphQL::Schema::Scalar +
    +
  • + + +
  • +
    + #specified_by_url + GraphQL::Introspection::TypeType +
    +
  • + + +
  • +
    + #start_cursor + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #static_errors + GraphQL::Query +
    +
  • + + +
  • +
    + static_include? + GraphQL::Schema::Directive +
    +
  • + + +
  • +
    + static_include? + GraphQL::Schema::Directive::Skip +
    +
  • + + +
  • +
    + static_include? + GraphQL::Schema::Directive::Include +
    +
  • + + +
  • +
    + #static_validator + GraphQL::Query +
    +
  • + + +
  • +
    + static_validator + GraphQL::Schema +
    +
  • + + +
  • +
    + #statically_coercible? + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #string + GraphQL::StringEncodingError +
    +
  • + + +
  • +
    + subclass_for + GraphQL::InvalidNullError +
    +
  • + + +
  • +
    + #subscribe + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + subscription + GraphQL::Schema +
    +
  • + + +
  • +
    + #subscription? + GraphQL::Query +
    +
  • + + +
  • +
    + subscription_execution_strategy + GraphQL::Schema +
    +
  • + + +
  • +
    + #subscription_scope + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + subscription_scope + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + subscription_scope_optional? + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + #subscription_topic + GraphQL::Query +
    +
  • + + +
  • +
    + #subscription_type + GraphQL::Introspection::SchemaType +
    +
  • + + +
  • +
    + #subscription_update? + GraphQL::Query +
    +
  • + + +
  • +
    + subscriptions + GraphQL::Schema +
    +
  • + + +
  • +
    + subscriptions= + GraphQL::Schema +
    +
  • + + +
  • +
    + #sync + GraphQL::Dataloader::Source +
    +
  • + + +
  • +
    + sync_lazy + GraphQL::Schema +
    +
  • + + +
  • +
    + #tap_or_each + GraphQL::Execution::Interpreter::Runtime +
    +
  • + + +
  • +
    + #target_name + GraphQL::StaticValidation::DirectivesAreInValidLocationsError +
    +
  • + + +
  • +
    + #terminal? + GraphQL::Analysis::AST::QueryComplexity::ScopedTypeComplexity +
    +
  • + + +
  • +
    + #then + GraphQL::Execution::Lazy +
    +
  • + + +
  • +
    + time_precision + GraphQL::Types::ISO8601DateTime +
    +
  • + + +
  • +
    + time_precision= + GraphQL::Types::ISO8601DateTime +
    +
  • + + +
  • +
    + #to_a + GraphQL::Backtrace +
    +
  • + + +
  • +
    + #to_backtrace + GraphQL::Backtrace::Table +
    +
  • + + +
  • +
    + to_definition + GraphQL::Schema +
    +
  • + + +
  • +
    + to_document + GraphQL::Schema +
    +
  • + + +
  • +
    + #to_f + GraphQL::Language::Token +
    +
  • + + +
  • +
    + #to_h + GraphQL::ParseError +
    +
  • + + +
  • +
    + #to_h + GraphQL::Query::Result +
    +
  • + + +
  • +
    + #to_h + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #to_h + GraphQL::Language::Nodes::InputObject +
    +
  • + + +
  • +
    + #to_h + GraphQL::ExecutionError +
    +
  • + + +
  • +
    + #to_h + GraphQL::InvalidNullError +
    +
  • + + +
  • +
    + #to_h + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::Error +
    +
  • + + +
  • +
    + #to_h + GraphQL::Query::VariableValidationError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::ValidationTimeoutError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::FieldsWillMergeError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::QueryRootExistsError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::FragmentsAreUsedError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::FragmentsAreNamedError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::FragmentTypesExistError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::FragmentsAreFiniteError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::MutationRootExistsError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::ArgumentsAreDefinedError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::DirectivesAreDefinedError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::SubscriptionRootExistsError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::ArgumentNamesAreUniqueError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::FragmentNamesAreUniqueError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::OperationNamesAreValidError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::VariableNamesAreUniqueError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::VariablesAreInputTypesError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::FieldsAreDefinedOnTypeError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::NoDefinitionsArePresentError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::VariableUsagesAreAllowedError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::FragmentSpreadsArePossibleError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::InputObjectNamesAreUniqueError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::OneOfInputObjectsAreValidError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::RequiredArgumentsArePresentError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::UniqueDirectivesPerLocationError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::VariablesAreUsedAndDefinedError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::FragmentsAreOnCompositeTypesError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::DirectivesAreInValidLocationsError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::FieldsHaveAppropriateSelectionsError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError +
    +
  • + + +
  • +
    + #to_h + GraphQL::StaticValidation::RequiredInputObjectAttributesArePresentError +
    +
  • + + +
  • +
    + #to_hash + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #to_i + GraphQL::Language::Token +
    +
  • + + +
  • +
    + #to_input_argument + Graphql::Generators::TypeGeneratorBase::NormalizedField +
    +
  • + + +
  • +
    + to_json + GraphQL::Schema +
    +
  • + + +
  • +
    + #to_kwargs + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #to_list_type + GraphQL::Schema::LateBoundType +
    +
  • + + +
  • +
    + #to_list_type + GraphQL::Schema::Member::TypeSystemHelpers +
    +
  • + + +
  • +
    + #to_non_null_type + GraphQL::Schema::LateBoundType +
    +
  • + + +
  • +
    + #to_non_null_type + GraphQL::Schema::Member::TypeSystemHelpers +
    +
  • + + +
  • +
    + #to_object_field + Graphql::Generators::TypeGeneratorBase::NormalizedField +
    +
  • + + +
  • +
    + #to_query_string + GraphQL::Language::Nodes::AbstractNode +
    +
  • + + +
  • +
    + #to_s + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #to_string + GraphQL::Language::Printer::TruncatableBuffer +
    +
  • + + +
  • +
    + #to_table + GraphQL::Backtrace::Table +
    +
  • + + +
  • +
    + to_type_name + GraphQL::Schema::Member::BuildType +
    +
  • + + +
  • +
    + #to_type_signature + GraphQL::Schema::List +
    +
  • + + +
  • +
    + #to_type_signature + GraphQL::Schema::NonNull +
    +
  • + + +
  • +
    + #to_type_signature + GraphQL::Schema::Member::TypeSystemHelpers +
    +
  • + + +
  • +
    + tokenize + GraphQL::Language::Lexer +
    +
  • + + +
  • +
    + #too_many_errors? + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + #topic + GraphQL::Subscriptions::Event +
    +
  • + + +
  • +
    + topic_for + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + #trace + GraphQL::Tracing::Traceable +
    +
  • + + +
  • +
    + trace + GraphQL::Tracing::NullTracer +
    +
  • + + +
  • +
    + #trace + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + trace + GraphQL::Backtrace::Tracer +
    +
  • + + +
  • +
    + #trace + GraphQL::Tracing::PlatformTracing +
    +
  • + + +
  • +
    + #trace + GraphQL::Tracing::NotificationsTracing +
    +
  • + + +
  • +
    + trace + GraphQL::Tracing::ActiveSupportNotificationsTracing +
    +
  • + + +
  • +
    + trace_class + GraphQL::Schema +
    +
  • + + +
  • +
    + trace_class_for + GraphQL::Schema +
    +
  • + + +
  • +
    + trace_mode + GraphQL::Schema +
    +
  • + + +
  • +
    + trace_modules_for + GraphQL::Schema +
    +
  • + + +
  • +
    + trace_options_for + GraphQL::Schema +
    +
  • + + +
  • +
    + trace_with + GraphQL::Schema +
    +
  • + + +
  • +
    + tracer + GraphQL::Schema +
    +
  • + + +
  • +
    + #tracer + GraphQL::Tracing::DataDogTracing +
    +
  • + + +
  • +
    + #tracers + GraphQL::Query +
    +
  • + + +
  • +
    + tracers + GraphQL::Schema +
    +
  • + + +
  • +
    + #trigger + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + trim_whitespace + GraphQL::Language::BlockString +
    +
  • + + +
  • +
    + #type + GraphQL::Schema::UnresolvedLateBoundTypeError +
    +
  • + + +
  • +
    + #type + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #type + GraphQL::Language::Nodes::FragmentDefinition +
    +
  • + + +
  • +
    + #type + GraphQL::Language::Nodes +
    +
  • + + +
  • +
    + #type + GraphQL::Language::Nodes::VariableDefinition +
    +
  • + + +
  • +
    + #type + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + type + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + #type + GraphQL::UnauthorizedError +
    +
  • + + +
  • +
    + #type + GraphQL::Schema::Resolver::HasPayloadType +
    +
  • + + +
  • +
    + #type + GraphQL::Tracing::PrometheusTracing::GraphQLCollector +
    +
  • + + +
  • +
    + #type= + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #type_definition + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #type_definition + GraphQL::StaticValidation::BaseVisitor::ContextMethods +
    +
  • + + +
  • +
    + type_error + GraphQL::Schema +
    +
  • + + +
  • +
    + type_expr + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + type_from_ast + GraphQL::Schema +
    +
  • + + +
  • +
    + type_membership_class + GraphQL::Schema::Union +
    +
  • + + +
  • +
    + #type_membership_class + GraphQL::Schema::Interface::DefinitionMethods +
    +
  • + + +
  • +
    + type_memberships + GraphQL::Schema::Union +
    +
  • + + +
  • +
    + #type_name + GraphQL::StaticValidation::FragmentTypesExistError +
    +
  • + + +
  • +
    + #type_name + GraphQL::StaticValidation::ArgumentsAreDefinedError +
    +
  • + + +
  • +
    + #type_name + GraphQL::StaticValidation::VariablesAreInputTypesError +
    +
  • + + +
  • +
    + #type_name + GraphQL::StaticValidation::FieldsAreDefinedOnTypeError +
    +
  • + + +
  • +
    + #type_name + GraphQL::StaticValidation::VariableUsagesAreAllowedError +
    +
  • + + +
  • +
    + #type_name + GraphQL::StaticValidation::FragmentSpreadsArePossibleError +
    +
  • + + +
  • +
    + #type_name + GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError +
    +
  • + + +
  • +
    + #type_name + GraphQL::StaticValidation::FragmentsAreOnCompositeTypesError +
    +
  • + + +
  • +
    + #type_name + GraphQL::StaticValidation::FieldsHaveAppropriateSelectionsError +
    +
  • + + +
  • +
    + #type_name + GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError +
    +
  • + + +
  • +
    + types + GraphQL::Schema +
    +
  • + + +
  • +
    + #types + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #types + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #types + GraphQL::Language::Nodes::UnionTypeDefinition +
    +
  • + + +
  • +
    + #types + GraphQL::Language::Nodes::UnionTypeExtension +
    +
  • + + +
  • +
    + #types + GraphQL::Schema::Addition +
    +
  • + + +
  • +
    + #types + GraphQL::Introspection::SchemaType +
    +
  • + + +
  • +
    + #types + GraphQL::Schema::IntrospectionSystem +
    +
  • + + +
  • +
    + unauthorized_field + GraphQL::Schema +
    +
  • + + +
  • +
    + unauthorized_object + GraphQL::Schema +
    +
  • + + +
  • +
    + #unauthorized_object + GraphQL::Schema::Resolver +
    +
  • + + +
  • +
    + underscore + GraphQL::Schema::Member::BuildType +
    +
  • + + +
  • +
    + uninstall + GraphQL::Schema::Validator +
    +
  • + + +
  • +
    + #union? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + union_memberships + GraphQL::Schema +
    +
  • + + +
  • +
    + #union_memberships + GraphQL::Schema::Addition +
    +
  • + + +
  • +
    + #unmet_dependencies + GraphQL::StaticValidation::DefinitionDependencies::DependencyMap +
    +
  • + + +
  • +
    + #unsubscribe + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + #unused_dependencies + GraphQL::StaticValidation::DefinitionDependencies::DependencyMap +
    +
  • + + +
  • +
    + #unwrap + GraphQL::Schema::Wrapper +
    +
  • + + +
  • +
    + #unwrap + GraphQL::Schema::Interface +
    +
  • + + +
  • +
    + #unwrap + GraphQL::Schema::LateBoundType +
    +
  • + + +
  • +
    + #unwrap_value + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + #update + GraphQL::Schema::Subscription +
    +
  • + + +
  • +
    + urlsafe_decode64 + Base64Bp +
    +
  • + + +
  • +
    + urlsafe_encode64 + Base64Bp +
    +
  • + + +
  • +
    + use + GraphQL::Schema +
    +
  • + + +
  • +
    + use + GraphQL::Backtrace +
    +
  • + + +
  • +
    + use + GraphQL::Dataloader +
    +
  • + + +
  • +
    + use + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + use + GraphQL::Schema::Timeout +
    +
  • + + +
  • +
    + use + GraphQL::Schema::AlwaysVisible +
    +
  • + + +
  • +
    + use + GraphQL::Tracing::PlatformTracing +
    +
  • + + +
  • +
    + #used? + GraphQL::StaticValidation::VariablesAreUsedAndDefined::VariableUsage +
    +
  • + + +
  • +
    + #used_by + GraphQL::StaticValidation::VariablesAreUsedAndDefined::VariableUsage +
    +
  • + + +
  • +
    + using_ast_analysis? + GraphQL::Schema +
    +
  • + + +
  • +
    + #valid? + GraphQL::Query +
    +
  • + + +
  • +
    + #valid? + GraphQL::Query::ValidationPipeline +
    +
  • + + +
  • +
    + #valid? + GraphQL::Query::InputValidationResult +
    +
  • + + +
  • +
    + #valid_input? + GraphQL::Schema::Member::ValidatesInput +
    +
  • + + +
  • +
    + #valid_isolated_input? + GraphQL::Schema::Member::ValidatesInput +
    +
  • + + +
  • +
    + #valid_regex + GraphQL::InvalidNameError +
    +
  • + + +
  • +
    + #validate + GraphQL::Query +
    +
  • + + +
  • +
    + validate + GraphQL::Schema +
    +
  • + + +
  • +
    + #validate + GraphQL::Tracing::Trace +
    +
  • + + +
  • +
    + #validate + GraphQL::Backtrace::Trace +
    +
  • + + +
  • +
    + #validate + GraphQL::Schema::Validator +
    +
  • + + +
  • +
    + #validate + GraphQL::Tracing::CallLegacyTracers +
    +
  • + + +
  • +
    + #validate + GraphQL::StaticValidation::Validator +
    +
  • + + +
  • +
    + #validate + GraphQL::Schema::Validator::FormatValidator +
    +
  • + + +
  • +
    + #validate + GraphQL::Schema::Validator::LengthValidator +
    +
  • + + +
  • +
    + #validate + GraphQL::Schema::Validator::RequiredValidator +
    +
  • + + +
  • +
    + #validate + GraphQL::StaticValidation::LiteralValidator +
    +
  • + + +
  • +
    + #validate + GraphQL::Schema::Validator::ExclusionValidator +
    +
  • + + +
  • +
    + #validate + GraphQL::Schema::Validator::InclusionValidator +
    +
  • + + +
  • +
    + #validate + GraphQL::Schema::Validator::AllowNullValidator +
    +
  • + + +
  • +
    + #validate + GraphQL::Schema::Validator::AllowBlankValidator +
    +
  • + + +
  • +
    + #validate + GraphQL::Schema::Validator::NumericalityValidator +
    +
  • + + +
  • +
    + validate! + GraphQL::NameValidator +
    +
  • + + +
  • +
    + validate! + GraphQL::Schema::Validator +
    +
  • + + +
  • +
    + #validate_arguments + GraphQL::StaticValidation::ArgumentNamesAreUnique +
    +
  • + + +
  • +
    + #validate_default_value + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + #validate_directive_argument + GraphQL::Schema::Member::HasArguments +
    +
  • + + +
  • +
    + #validate_directive_argument + GraphQL::Schema::Member::HasArguments::HasDirectiveArguments +
    +
  • + + +
  • +
    + #validate_input + GraphQL::Schema::NonNull +
    +
  • + + +
  • +
    + #validate_input + GraphQL::Schema::Member::ValidatesInput +
    +
  • + + +
  • +
    + #validate_literal + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + validate_max_errors + GraphQL::Schema +
    +
  • + + +
  • +
    + validate_non_null_input + GraphQL::Schema::Enum +
    +
  • + + +
  • +
    + #validate_non_null_input + GraphQL::Schema::List +
    +
  • + + +
  • +
    + validate_non_null_input + GraphQL::Schema::Scalar +
    +
  • + + +
  • +
    + validate_non_null_input + GraphQL::Schema::InputObject +
    +
  • + + +
  • +
    + validate_timeout + GraphQL::Schema +
    +
  • + + +
  • +
    + #validate_update? + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + #validated + GraphQL::Schema::Validator +
    +
  • + + +
  • +
    + #validates + GraphQL::Schema::Member::HasValidators +
    +
  • + + +
  • +
    + #validation_errors + GraphQL::Query::ValidationPipeline +
    +
  • + + +
  • +
    + #validation_pipeline + GraphQL::Query +
    +
  • + + +
  • +
    + #validation_result + GraphQL::Query::VariableValidationError +
    +
  • + + +
  • +
    + #validators + GraphQL::Schema::Member::HasValidators +
    +
  • + + +
  • +
    + #validators + GraphQL::Schema::Member::HasValidators::ClassConfigured::ClassValidators +
    +
  • + + +
  • +
    + value + GraphQL::Schema::Enum +
    +
  • + + +
  • +
    + #value + GraphQL::Execution::Lazy +
    +
  • + + +
  • +
    + #value + GraphQL::Language::Nodes::Argument +
    +
  • + + +
  • +
    + #value + GraphQL::Language::Token +
    +
  • + + +
  • +
    + #value + GraphQL::Schema::EnumValue +
    +
  • + + +
  • +
    + #value + GraphQL::InvalidNullError +
    +
  • + + +
  • +
    + #value + GraphQL::UnresolvedTypeError +
    +
  • + + +
  • +
    + #value + GraphQL::Query::VariableValidationError +
    +
  • + + +
  • +
    + #value + GraphQL::Execution::Interpreter::ArgumentValue +
    +
  • + + +
  • +
    + #value + GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError +
    +
  • + + +
  • +
    + values + GraphQL::Schema::Enum +
    +
  • + + +
  • +
    + #values + GraphQL::Execution::Interpreter::Runtime::GraphQLResultHash +
    +
  • + + +
  • +
    + #values + GraphQL::Execution::Interpreter::Runtime::GraphQLResultArray +
    +
  • + + +
  • +
    + #variable_name + GraphQL::StaticValidation::VariableNamesAreUniqueError +
    +
  • + + +
  • +
    + #variable_name + GraphQL::StaticValidation::VariablesAreInputTypesError +
    +
  • + + +
  • +
    + #variable_name + GraphQL::StaticValidation::VariableUsagesAreAllowedError +
    +
  • + + +
  • +
    + #variable_name + GraphQL::StaticValidation::VariablesAreUsedAndDefinedError +
    +
  • + + +
  • +
    + #variable_name + GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError +
    +
  • + + +
  • +
    + #variables + GraphQL::Query +
    +
  • + + +
  • +
    + #variables + GraphQL::Language::Nodes::OperationDefinition +
    +
  • + + +
  • +
    + #variables_fingerprint + GraphQL::Query +
    +
  • + + +
  • +
    + version + GraphQL::Tracing::AppOpticsTrace +
    +
  • + + +
  • +
    + version + GraphQL::Tracing::AppOpticsTracing +
    +
  • + + +
  • +
    + #violation + GraphQL::StaticValidation::VariablesAreUsedAndDefinedError +
    +
  • + + +
  • +
    + #violation + GraphQL::StaticValidation::VariableDefaultValuesAreCorrectlyTypedError +
    +
  • + + +
  • +
    + visible? + GraphQL::Schema +
    +
  • + + +
  • +
    + #visible? + GraphQL::Schema::Field +
    +
  • + + +
  • +
    + #visible? + GraphQL::Schema::Argument +
    +
  • + + +
  • +
    + visible? + GraphQL::Schema::Mutation +
    +
  • + + +
  • +
    + #visible? + GraphQL::Schema::Interface::DefinitionMethods +
    +
  • + + +
  • +
    + #visible? + GraphQL::Schema::EnumValue +
    +
  • + + +
  • +
    + #visible? + GraphQL::Schema::TypeMembership +
    +
  • + + +
  • +
    + #visible? + GraphQL::Schema::Directive::Flagged::VisibleByFlag +
    +
  • + + +
  • +
    + #visible? + GraphQL::Types::Relay::EdgeBehaviors::ClassMethods +
    +
  • + + +
  • +
    + #visible? + GraphQL::Schema::Member::BaseDSLMethods +
    +
  • + + +
  • +
    + #visible? + GraphQL::Types::Relay::ConnectionBehaviors::ClassMethods +
    +
  • + + +
  • +
    + visible_argument? + GraphQL::Schema::Warden::PassThruWarden +
    +
  • + + +
  • +
    + #visible_argument? + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #visible_argument? + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + visible_entry? + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + visible_enum_value? + GraphQL::Schema::Warden::PassThruWarden +
    +
  • + + +
  • +
    + #visible_enum_value? + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #visible_enum_value? + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + visible_field? + GraphQL::Schema::Warden::PassThruWarden +
    +
  • + + +
  • +
    + #visible_field? + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #visible_field? + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + visible_type? + GraphQL::Schema::Warden::PassThruWarden +
    +
  • + + +
  • +
    + #visible_type? + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #visible_type? + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + visible_type_membership? + GraphQL::Schema::Warden::PassThruWarden +
    +
  • + + +
  • +
    + #visible_type_membership? + GraphQL::Schema::Warden::NullWarden +
    +
  • + + +
  • +
    + #visible_type_membership? + GraphQL::Schema::Warden +
    +
  • + + +
  • +
    + #visit + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + #visit + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #visit + GraphQL::Language::StaticVisitor +
    +
  • + + +
  • +
    + #visit? + GraphQL::Analysis::AST::Analyzer +
    +
  • + + +
  • +
    + #visit_directives + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + #visit_directives + GraphQL::Language::StaticVisitor +
    +
  • + + +
  • +
    + #visit_selections + GraphQL::Language::Visitor +
    +
  • + + +
  • +
    + #visit_selections + GraphQL::Language::StaticVisitor +
    +
  • + + +
  • +
    + #visiting_fragment_definition? + GraphQL::Analysis::AST::Visitor +
    +
  • + + +
  • +
    + #visitor + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + #warden + GraphQL::Query +
    +
  • + + +
  • +
    + #warden + GraphQL::Query::Context +
    +
  • + + +
  • +
    + #warden + GraphQL::Schema::Printer +
    +
  • + + +
  • +
    + #warden + GraphQL::Query::NullContext +
    +
  • + + +
  • +
    + #warden + GraphQL::StaticValidation::ValidationContext +
    +
  • + + +
  • +
    + warden_class + GraphQL::Schema +
    +
  • + + +
  • +
    + warn + GraphQL::Deprecation +
    +
  • + + +
  • +
    + #was_authorized_by_scope_items + GraphQL::Execution::Interpreter::Runtime::CurrentState +
    +
  • + + +
  • +
    + #was_authorized_by_scope_items? + GraphQL::Pagination::Connection +
    +
  • + + +
  • +
    + #was_authorized_by_scope_items? + GraphQL::Pagination::Connection::Edge +
    +
  • + + +
  • +
    + #with + GraphQL::Dataloader +
    +
  • + + +
  • +
    + with_dataloading + GraphQL::Dataloader +
    +
  • + + +
  • +
    + wrap + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + #wrap + GraphQL::Pagination::Connections +
    +
  • + + +
  • +
    + wrap_scoped + GraphQL::Schema::Object +
    +
  • + + +
  • +
    + #wrapper_for + GraphQL::Pagination::Connections +
    +
  • + + +
  • +
    + #wraps? + GraphQL::TypeKinds::TypeKind +
    +
  • + + +
  • +
    + #write_subscription + GraphQL::Subscriptions +
    +
  • + + +
  • +
    + #write_subscription + GraphQL::Subscriptions::ActionCableSubscriptions +
    +
  • + + +
  • +
    + #yield + GraphQL::Dataloader +
    +
  • + + +
  • +
    + #yield + GraphQL::Dataloader::NullDataloader +
    +
  • + + + +
+
+ + diff --git a/api-doc/2.1.6/top-level-namespace.html b/api-doc/2.1.6/top-level-namespace.html new file mode 100644 index 0000000000..5561f5617e --- /dev/null +++ b/api-doc/2.1.6/top-level-namespace.html @@ -0,0 +1,110 @@ + + + + + + + Top Level Namespace + + — GraphQL Ruby API Documentation + + + + + + + + + + + + + + + + + + + +
+ + +

Top Level Namespace + + + +

+
+ + + + + + + + + + + +
+ +

Defined Under Namespace

+

+ + + Modules: Base64Bp, GraphQL, Graphql + + + + +

+ + + + + + + + + +
+ + + +
+ + \ No newline at end of file