├── README.md ├── composer.json ├── composer.lock ├── functions.php ├── src ├── Connection │ ├── Sidebar.php │ ├── WPMediaImageWidget.php │ ├── WPNavMenuWidget.php │ ├── WPWidgetCategories.php │ ├── WPWidgetPages.php │ ├── WPWidgetRecentComments.php │ ├── WPWidgetRecentPosts.php │ └── WidgetInterface.php ├── Data │ ├── Connection │ │ ├── SidebarConnectionResolver.php │ │ └── WidgetConnectionResolver.php │ └── Loader │ │ ├── SidebarLoader.php │ │ └── WidgetLoader.php ├── Model │ ├── Sidebar.php │ └── Widget.php ├── Registry.php ├── Type │ ├── Enum │ │ └── SidebarEnum.php │ ├── InterfaceType │ │ └── WidgetInterface.php │ ├── ObjectType │ │ └── Sidebar.php │ ├── Widget.php │ └── WidgetTypes.php └── WPGraphQLWidgets.php ├── vendor ├── autoload.php ├── composer │ ├── ClassLoader.php │ ├── LICENSE │ ├── autoload_classmap.php │ ├── autoload_files.php │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_real.php │ ├── autoload_static.php │ └── installed.json ├── ivome │ └── graphql-relay-php │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ ├── contributors.txt │ │ ├── phpunit.xml │ │ ├── src │ │ ├── Connection │ │ │ ├── ArrayConnection.php │ │ │ └── Connection.php │ │ ├── Mutation │ │ │ └── Mutation.php │ │ ├── Node │ │ │ ├── Node.php │ │ │ └── Plural.php │ │ └── Relay.php │ │ └── tests │ │ ├── Connection │ │ ├── ArrayConnectionTest.php │ │ ├── ConnectionTest.php │ │ └── SeparateConnectionTest.php │ │ ├── Mutation │ │ └── MutationTest.php │ │ ├── Node │ │ ├── NodeTest.php │ │ └── PluralTest.php │ │ ├── RelayTest.php │ │ ├── StarWarsConnectionTest.php │ │ ├── StarWarsData.php │ │ ├── StarWarsMutationTest.php │ │ ├── StarWarsObjectIdentificationTest.php │ │ └── StarWarsSchema.php ├── webonyx │ └── graphql-php │ │ ├── .coveralls.yml │ │ ├── .github │ │ ├── FUNDING.yml │ │ └── workflows │ │ │ └── ci-build.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── UPGRADE.md │ │ ├── composer.json │ │ ├── docs │ │ ├── best-practices.md │ │ ├── complementary-tools.md │ │ ├── concepts.md │ │ ├── data-fetching.md │ │ ├── error-handling.md │ │ ├── executing-queries.md │ │ ├── getting-started.md │ │ ├── how-it-works.md │ │ ├── index.md │ │ ├── reference.md │ │ ├── security.md │ │ └── type-system │ │ │ ├── directives.md │ │ │ ├── enum-types.md │ │ │ ├── index.md │ │ │ ├── input-types.md │ │ │ ├── interfaces.md │ │ │ ├── lists-and-nonnulls.md │ │ │ ├── object-types.md │ │ │ ├── scalar-types.md │ │ │ ├── schema.md │ │ │ ├── type-language.md │ │ │ └── unions.md │ │ ├── phpcs.xml.dist │ │ ├── phpstan-baseline.neon │ │ ├── phpstan.neon.dist │ │ └── src │ │ ├── Deferred.php │ │ ├── Error │ │ ├── ClientAware.php │ │ ├── DebugFlag.php │ │ ├── Error.php │ │ ├── FormattedError.php │ │ ├── InvariantViolation.php │ │ ├── SyntaxError.php │ │ ├── UserError.php │ │ └── Warning.php │ │ ├── Exception │ │ └── InvalidArgument.php │ │ ├── Executor │ │ ├── ExecutionContext.php │ │ ├── ExecutionResult.php │ │ ├── Executor.php │ │ ├── ExecutorImplementation.php │ │ ├── Promise │ │ │ ├── Adapter │ │ │ │ ├── AmpPromiseAdapter.php │ │ │ │ ├── ReactPromiseAdapter.php │ │ │ │ ├── SyncPromise.php │ │ │ │ └── SyncPromiseAdapter.php │ │ │ ├── Promise.php │ │ │ └── PromiseAdapter.php │ │ ├── ReferenceExecutor.php │ │ └── Values.php │ │ ├── Experimental │ │ └── Executor │ │ │ ├── Collector.php │ │ │ ├── CoroutineContext.php │ │ │ ├── CoroutineContextShared.php │ │ │ ├── CoroutineExecutor.php │ │ │ ├── Runtime.php │ │ │ └── Strand.php │ │ ├── GraphQL.php │ │ ├── Language │ │ ├── AST │ │ │ ├── ArgumentNode.php │ │ │ ├── BooleanValueNode.php │ │ │ ├── DefinitionNode.php │ │ │ ├── DirectiveDefinitionNode.php │ │ │ ├── DirectiveNode.php │ │ │ ├── DocumentNode.php │ │ │ ├── EnumTypeDefinitionNode.php │ │ │ ├── EnumTypeExtensionNode.php │ │ │ ├── EnumValueDefinitionNode.php │ │ │ ├── EnumValueNode.php │ │ │ ├── ExecutableDefinitionNode.php │ │ │ ├── FieldDefinitionNode.php │ │ │ ├── FieldNode.php │ │ │ ├── FloatValueNode.php │ │ │ ├── FragmentDefinitionNode.php │ │ │ ├── FragmentSpreadNode.php │ │ │ ├── HasSelectionSet.php │ │ │ ├── InlineFragmentNode.php │ │ │ ├── InputObjectTypeDefinitionNode.php │ │ │ ├── InputObjectTypeExtensionNode.php │ │ │ ├── InputValueDefinitionNode.php │ │ │ ├── IntValueNode.php │ │ │ ├── InterfaceTypeDefinitionNode.php │ │ │ ├── InterfaceTypeExtensionNode.php │ │ │ ├── ListTypeNode.php │ │ │ ├── ListValueNode.php │ │ │ ├── Location.php │ │ │ ├── NameNode.php │ │ │ ├── NamedTypeNode.php │ │ │ ├── Node.php │ │ │ ├── NodeKind.php │ │ │ ├── NodeList.php │ │ │ ├── NonNullTypeNode.php │ │ │ ├── NullValueNode.php │ │ │ ├── ObjectFieldNode.php │ │ │ ├── ObjectTypeDefinitionNode.php │ │ │ ├── ObjectTypeExtensionNode.php │ │ │ ├── ObjectValueNode.php │ │ │ ├── OperationDefinitionNode.php │ │ │ ├── OperationTypeDefinitionNode.php │ │ │ ├── ScalarTypeDefinitionNode.php │ │ │ ├── ScalarTypeExtensionNode.php │ │ │ ├── SchemaDefinitionNode.php │ │ │ ├── SchemaTypeExtensionNode.php │ │ │ ├── SelectionNode.php │ │ │ ├── SelectionSetNode.php │ │ │ ├── StringValueNode.php │ │ │ ├── TypeDefinitionNode.php │ │ │ ├── TypeExtensionNode.php │ │ │ ├── TypeNode.php │ │ │ ├── TypeSystemDefinitionNode.php │ │ │ ├── UnionTypeDefinitionNode.php │ │ │ ├── UnionTypeExtensionNode.php │ │ │ ├── ValueNode.php │ │ │ ├── VariableDefinitionNode.php │ │ │ └── VariableNode.php │ │ ├── DirectiveLocation.php │ │ ├── Lexer.php │ │ ├── Parser.php │ │ ├── Printer.php │ │ ├── Source.php │ │ ├── SourceLocation.php │ │ ├── Token.php │ │ ├── Visitor.php │ │ └── VisitorOperation.php │ │ ├── Server │ │ ├── Helper.php │ │ ├── OperationParams.php │ │ ├── RequestError.php │ │ ├── ServerConfig.php │ │ └── StandardServer.php │ │ ├── Type │ │ ├── Definition │ │ │ ├── AbstractType.php │ │ │ ├── BooleanType.php │ │ │ ├── CompositeType.php │ │ │ ├── CustomScalarType.php │ │ │ ├── Directive.php │ │ │ ├── EnumType.php │ │ │ ├── EnumValueDefinition.php │ │ │ ├── FieldArgument.php │ │ │ ├── FieldDefinition.php │ │ │ ├── FloatType.php │ │ │ ├── HasFieldsType.php │ │ │ ├── IDType.php │ │ │ ├── ImplementingType.php │ │ │ ├── InputObjectField.php │ │ │ ├── InputObjectType.php │ │ │ ├── InputType.php │ │ │ ├── IntType.php │ │ │ ├── InterfaceType.php │ │ │ ├── LeafType.php │ │ │ ├── ListOfType.php │ │ │ ├── NamedType.php │ │ │ ├── NonNull.php │ │ │ ├── NullableType.php │ │ │ ├── ObjectType.php │ │ │ ├── OutputType.php │ │ │ ├── QueryPlan.php │ │ │ ├── ResolveInfo.php │ │ │ ├── ScalarType.php │ │ │ ├── StringType.php │ │ │ ├── Type.php │ │ │ ├── TypeWithFields.php │ │ │ ├── UnionType.php │ │ │ ├── UnmodifiedType.php │ │ │ ├── UnresolvedFieldDefinition.php │ │ │ └── WrappingType.php │ │ ├── Introspection.php │ │ ├── Schema.php │ │ ├── SchemaConfig.php │ │ ├── SchemaValidationContext.php │ │ ├── TypeKind.php │ │ └── Validation │ │ │ └── InputObjectCircularRefs.php │ │ ├── Utils │ │ ├── AST.php │ │ ├── ASTDefinitionBuilder.php │ │ ├── BlockString.php │ │ ├── BreakingChangesFinder.php │ │ ├── BuildClientSchema.php │ │ ├── BuildSchema.php │ │ ├── InterfaceImplementations.php │ │ ├── MixedStore.php │ │ ├── PairSet.php │ │ ├── SchemaExtender.php │ │ ├── SchemaPrinter.php │ │ ├── TypeComparators.php │ │ ├── TypeInfo.php │ │ ├── Utils.php │ │ └── Value.php │ │ └── Validator │ │ ├── ASTValidationContext.php │ │ ├── DocumentValidator.php │ │ ├── Rules │ │ ├── CustomValidationRule.php │ │ ├── DisableIntrospection.php │ │ ├── ExecutableDefinitions.php │ │ ├── FieldsOnCorrectType.php │ │ ├── FragmentsOnCompositeTypes.php │ │ ├── KnownArgumentNames.php │ │ ├── KnownArgumentNamesOnDirectives.php │ │ ├── KnownDirectives.php │ │ ├── KnownFragmentNames.php │ │ ├── KnownTypeNames.php │ │ ├── LoneAnonymousOperation.php │ │ ├── LoneSchemaDefinition.php │ │ ├── NoFragmentCycles.php │ │ ├── NoUndefinedVariables.php │ │ ├── NoUnusedFragments.php │ │ ├── NoUnusedVariables.php │ │ ├── OverlappingFieldsCanBeMerged.php │ │ ├── PossibleFragmentSpreads.php │ │ ├── ProvidedRequiredArguments.php │ │ ├── ProvidedRequiredArgumentsOnDirectives.php │ │ ├── QueryComplexity.php │ │ ├── QueryDepth.php │ │ ├── QuerySecurityRule.php │ │ ├── ScalarLeafs.php │ │ ├── SingleFieldSubscription.php │ │ ├── UniqueArgumentNames.php │ │ ├── UniqueDirectivesPerLocation.php │ │ ├── UniqueFragmentNames.php │ │ ├── UniqueInputFieldNames.php │ │ ├── UniqueOperationNames.php │ │ ├── UniqueVariableNames.php │ │ ├── ValidationRule.php │ │ ├── ValuesOfCorrectType.php │ │ ├── VariablesAreInputTypes.php │ │ └── VariablesInAllowedPosition.php │ │ ├── SDLValidationContext.php │ │ └── ValidationContext.php └── wp-graphql │ └── wp-graphql │ ├── .codeclimate.yml │ ├── .distignore │ ├── .wordpress-org │ ├── banner-1544x500.png │ ├── banner-772x250.png │ ├── icon-128x128.png │ ├── icon-256x256.png │ ├── screenshot-1.jpg │ └── screenshot-2.jpg │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── access-functions.php │ ├── activation.php │ ├── cli │ ├── README.md │ └── wp-cli.php │ ├── codeception.yml │ ├── composer.json │ ├── composer.lock │ ├── deactivation.php │ ├── package-lock.json │ ├── package.json │ ├── phpcs.xml.dist │ ├── readme.txt │ ├── src │ ├── Admin │ │ ├── Admin.php │ │ ├── GraphiQL │ │ │ ├── GraphiQL.php │ │ │ ├── README.md │ │ │ ├── app │ │ │ │ ├── README.md │ │ │ │ ├── build │ │ │ │ │ ├── asset-manifest.json │ │ │ │ │ ├── index.html │ │ │ │ │ ├── service-worker.js │ │ │ │ │ └── static │ │ │ │ │ │ ├── css │ │ │ │ │ │ ├── main.aafb6422.css │ │ │ │ │ │ └── main.aafb6422.css.map │ │ │ │ │ │ ├── js │ │ │ │ │ │ ├── main.b7d08b5b.js │ │ │ │ │ │ └── main.b7d08b5b.js.map │ │ │ │ │ │ └── media │ │ │ │ │ │ ├── GraphQLLanguageService.js.5ab204b9.flow │ │ │ │ │ │ ├── autocompleteUtils.js.4ce7ba19.flow │ │ │ │ │ │ ├── getAutocompleteSuggestions.js.7f98f032.flow │ │ │ │ │ │ ├── getDefinition.js.4dbec62f.flow │ │ │ │ │ │ ├── getDiagnostics.js.65b0979a.flow │ │ │ │ │ │ ├── getHoverInformation.js.d9411837.flow │ │ │ │ │ │ ├── getOutline.js.c04e3998.flow │ │ │ │ │ │ └── index.js.02c24280.flow │ │ │ │ ├── package-lock.json │ │ │ │ ├── package.json │ │ │ │ ├── public │ │ │ │ │ └── index.html │ │ │ │ ├── src │ │ │ │ │ ├── App.js │ │ │ │ │ ├── app.css │ │ │ │ │ ├── index.js │ │ │ │ │ └── snippets.js │ │ │ │ └── yarn.lock │ │ │ └── js │ │ │ │ └── graphiql-helpers.js │ │ ├── README.md │ │ └── Settings │ │ │ ├── Settings.php │ │ │ └── SettingsRegistry.php │ ├── AppContext.php │ ├── Connection │ │ ├── Comments.php │ │ ├── MenuItems.php │ │ ├── PostObjects.php │ │ ├── README.md │ │ ├── Revisions.php │ │ ├── Taxonomies.php │ │ ├── TermObjects.php │ │ └── Users.php │ ├── Data │ │ ├── CommentMutation.php │ │ ├── Config.php │ │ ├── Connection │ │ │ ├── AbstractConnectionResolver.php │ │ │ ├── CommentConnectionResolver.php │ │ │ ├── ContentTypeConnectionResolver.php │ │ │ ├── EnqueuedScriptsConnectionResolver.php │ │ │ ├── EnqueuedStylesheetConnectionResolver.php │ │ │ ├── MenuConnectionResolver.php │ │ │ ├── MenuItemConnectionResolver.php │ │ │ ├── PluginConnectionResolver.php │ │ │ ├── PostObjectConnectionResolver.php │ │ │ ├── TaxonomyConnectionResolver.php │ │ │ ├── TermObjectConnectionResolver.php │ │ │ ├── ThemeConnectionResolver.php │ │ │ ├── UserConnectionResolver.php │ │ │ └── UserRoleConnectionResolver.php │ │ ├── Cursor │ │ │ ├── CursorBuilder.php │ │ │ ├── PostObjectCursor.php │ │ │ ├── TermObjectCursor.php │ │ │ └── UserCursor.php │ │ ├── DataSource.php │ │ ├── Loader │ │ │ ├── AbstractDataLoader.php │ │ │ ├── CommentAuthorLoader.php │ │ │ ├── CommentLoader.php │ │ │ ├── EnqueuedScriptLoader.php │ │ │ ├── EnqueuedStylesheetLoader.php │ │ │ ├── PluginLoader.php │ │ │ ├── PostObjectLoader.php │ │ │ ├── PostTypeLoader.php │ │ │ ├── README.md │ │ │ ├── TaxonomyLoader.php │ │ │ ├── TermObjectLoader.php │ │ │ ├── ThemeLoader.php │ │ │ ├── UserLoader.php │ │ │ └── UserRoleLoader.php │ │ ├── MediaItemMutation.php │ │ ├── NodeResolver.php │ │ ├── PostObjectMutation.php │ │ ├── README.md │ │ ├── TermObjectMutation.php │ │ └── UserMutation.php │ ├── Model │ │ ├── Avatar.php │ │ ├── Comment.php │ │ ├── CommentAuthor.php │ │ ├── Menu.php │ │ ├── MenuItem.php │ │ ├── Model.php │ │ ├── Plugin.php │ │ ├── Post.php │ │ ├── PostType.php │ │ ├── Taxonomy.php │ │ ├── Term.php │ │ ├── Theme.php │ │ ├── User.php │ │ └── UserRole.php │ ├── Mutation │ │ ├── CommentCreate.php │ │ ├── CommentDelete.php │ │ ├── CommentRestore.php │ │ ├── CommentUpdate.php │ │ ├── MediaItemCreate.php │ │ ├── MediaItemDelete.php │ │ ├── MediaItemUpdate.php │ │ ├── PostObjectCreate.php │ │ ├── PostObjectDelete.php │ │ ├── PostObjectUpdate.php │ │ ├── README.md │ │ ├── ResetUserPassword.php │ │ ├── SendPasswordResetEmail.php │ │ ├── TermObjectCreate.php │ │ ├── TermObjectDelete.php │ │ ├── TermObjectUpdate.php │ │ ├── UpdateSettings.php │ │ ├── UserCreate.php │ │ ├── UserDelete.php │ │ ├── UserRegister.php │ │ └── UserUpdate.php │ ├── Registry │ │ ├── SchemaRegistry.php │ │ └── TypeRegistry.php │ ├── Request.php │ ├── Router.php │ ├── Server │ │ ├── ValidationRules │ │ │ ├── DisableIntrospection.php │ │ │ ├── QueryDepth.php │ │ │ └── RequireAuthentication.php │ │ └── WPHelper.php │ ├── Type │ │ ├── Enum │ │ │ ├── AvatarRatingEnum.php │ │ │ ├── CommentsConnectionOrderbyEnum.php │ │ │ ├── ContentNodeIdTypeEnum.php │ │ │ ├── ContentTypeEnum.php │ │ │ ├── ContentTypeIdTypeEnum.php │ │ │ ├── MediaItemSizeEnum.php │ │ │ ├── MediaItemStatusEnum.php │ │ │ ├── MenuItemNodeIdTypeEnum.php │ │ │ ├── MenuLocationEnum.php │ │ │ ├── MenuNodeIdTypeEnum.php │ │ │ ├── MimeTypeEnum.php │ │ │ ├── OrderEnum.php │ │ │ ├── PostObjectFieldFormatEnum.php │ │ │ ├── PostObjectsConnectionDateColumnEnum.php │ │ │ ├── PostObjectsConnectionOrderbyEnum.php │ │ │ ├── PostStatusEnum.php │ │ │ ├── RelationEnum.php │ │ │ ├── TaxonomyEnum.php │ │ │ ├── TaxonomyIdTypeEnum.php │ │ │ ├── TermNodeIdTypeEnum.php │ │ │ ├── TermObjectsConnectionOrderbyEnum.php │ │ │ ├── TimezoneEnum.php │ │ │ ├── UserNodeIdTypeEnum.php │ │ │ ├── UserRoleEnum.php │ │ │ ├── UsersConnectionOrderbyEnum.php │ │ │ └── UsersConnectionSearchColumnEnum.php │ │ ├── Input │ │ │ ├── DateInput.php │ │ │ ├── DateQueryInput.php │ │ │ ├── PostObjectsConnectionOrderbyInput.php │ │ │ └── UsersConnectionOrderbyInput.php │ │ ├── InterfaceType │ │ │ ├── CommenterInterface.php │ │ │ ├── ContentNode.php │ │ │ ├── ContentTemplate.php │ │ │ ├── DatabaseIdentifier.php │ │ │ ├── EnqueuedAsset.php │ │ │ ├── HierarchicalContentNode.php │ │ │ ├── HierarchicalTermNode.php │ │ │ ├── MenuItemLinkable.php │ │ │ ├── Node.php │ │ │ ├── NodeWithAuthor.php │ │ │ ├── NodeWithComments.php │ │ │ ├── NodeWithContentEditor.php │ │ │ ├── NodeWithExcerpt.php │ │ │ ├── NodeWithFeaturedImage.php │ │ │ ├── NodeWithPageAttributes.php │ │ │ ├── NodeWithRevisions.php │ │ │ ├── NodeWithTemplate.php │ │ │ ├── NodeWithTitle.php │ │ │ ├── NodeWithTrackbacks.php │ │ │ ├── TermNode.php │ │ │ └── UniformResourceIdentifiable.php │ │ ├── ObjectType │ │ │ ├── Avatar.php │ │ │ ├── Comment.php │ │ │ ├── CommentAuthor.php │ │ │ ├── ContentType.php │ │ │ ├── EnqueuedScript.php │ │ │ ├── EnqueuedStylesheet.php │ │ │ ├── MediaDetails.php │ │ │ ├── MediaItemMeta.php │ │ │ ├── MediaSize.php │ │ │ ├── Menu.php │ │ │ ├── MenuItem.php │ │ │ ├── PageInfo.php │ │ │ ├── Plugin.php │ │ │ ├── PostObject.php │ │ │ ├── PostTypeLabelDetails.php │ │ │ ├── RootMutation.php │ │ │ ├── RootQuery.php │ │ │ ├── SettingGroup.php │ │ │ ├── Settings.php │ │ │ ├── Taxonomy.php │ │ │ ├── TermObject.php │ │ │ ├── Theme.php │ │ │ ├── User.php │ │ │ └── UserRole.php │ │ ├── README.md │ │ ├── Union │ │ │ ├── ContentRevisionUnion.php │ │ │ ├── MenuItemObjectUnion.php │ │ │ ├── PostObjectUnion.php │ │ │ └── TermObjectUnion.php │ │ ├── WPConnectionType.php │ │ ├── WPEnumType.php │ │ ├── WPInputObjectType.php │ │ ├── WPInterfaceTrait.php │ │ ├── WPInterfaceType.php │ │ ├── WPObjectType.php │ │ ├── WPScalar.php │ │ └── WPUnionType.php │ ├── Types.php │ ├── Utils │ │ ├── DebugLog.php │ │ ├── InstrumentSchema.php │ │ ├── Preview.php │ │ ├── QueryLog.php │ │ ├── Tracing.php │ │ └── Utils.php │ ├── WPGraphQL.php │ └── WPSchema.php │ └── wp-graphql.php └── wp-graphql-widgets.php /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "benada002/gl-shop-plugin", 3 | "description": "Expose widgets to WPGraphQL", 4 | "type": "wordpress-plugin", 5 | "authors": [ 6 | { 7 | "name": "benada002" 8 | } 9 | ], 10 | "autoload": { 11 | "files": [ 12 | "functions.php" 13 | ], 14 | "psr-4": { 15 | "WPGraphQLWidgets\\": "src/" 16 | } 17 | }, 18 | "require": { 19 | "php": ">=7.1.0", 20 | "wp-graphql/wp-graphql": "^1.6", 21 | "ivome/graphql-relay-php": "^0.6.0" 22 | }, 23 | "require-dev": { 24 | "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", 25 | "php-stubs/wordpress-stubs": "^5.6", 26 | "wp-coding-standards/wpcs": "^2.3" 27 | } 28 | } -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | registerWidgetType($widget_type, $config); 9 | }, 10 | 10 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /src/Connection/Sidebar.php: -------------------------------------------------------------------------------- 1 | 'WidgetInterface', 15 | 'toType' => 'Sidebar', 16 | 'fromFieldName' => 'sidebar', 17 | 'oneToOne' => true, 18 | 'resolve' => function ( $widget, $args, $context, $info ) { 19 | $sidebarId = Registry::init()->getSidebarIdByInstanceId($widget->databaseId); 20 | $resolver = new SidebarConnectionResolver($widget, $args, $context, $info); 21 | $resolver->set_query_arg('sidebar', $sidebarId); 22 | 23 | return $resolver->one_to_one()->get_connection(); 24 | }, 25 | ] 26 | ); 27 | 28 | register_graphql_connection( 29 | [ 30 | 'fromType' => 'RootQuery', 31 | 'toType' => 'Sidebar', 32 | 'fromFieldName' => 'sidebars', 33 | 'connectionArgs' => [ 34 | 'sidebar' => [ 35 | 'type' => [ 36 | 'non_null' => 'SidebarEnum' 37 | ] 38 | ] 39 | ], 40 | 'resolve' => function ( $sidebar, $args, $context, $info ) { 41 | $resolver = new SidebarConnectionResolver($sidebar, $args, $context, $info); 42 | return $resolver->get_connection(); 43 | } 44 | ] 45 | ); 46 | } 47 | } -------------------------------------------------------------------------------- /src/Connection/WPMediaImageWidget.php: -------------------------------------------------------------------------------- 1 | 'WPWidgetMediaImage', 14 | 'toType' => 'MediaItem', 15 | 'fromFieldName' => 'rendered', 16 | 'oneToOne' => true, 17 | 'resolve' => function ( $widget, $args, $context, $info ) { 18 | if ( empty( $widget->attachmentId) ) { 19 | return null; 20 | } 21 | 22 | $resolver = new PostObjectConnectionResolver( $widget, $args, $context, $info, 'attachment' ); 23 | $resolver->set_query_arg( 'p', absint( $widget->attachmentId ) ); 24 | 25 | return $resolver->one_to_one()->get_connection(); 26 | }, 27 | ] 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Connection/WPNavMenuWidget.php: -------------------------------------------------------------------------------- 1 | 'WPNavMenuWidget', 14 | 'toType' => 'Menu', 15 | 'fromFieldName' => 'rendered', 16 | 'oneToOne' => true, 17 | 'resolve' => function ( $widget, $args, $context, $info ) { 18 | $resolver = new MenuConnectionResolver($widget, $args, $context, $info); 19 | $resolver->set_query_arg('include', $widget->navMenu); 20 | return $resolver->one_to_one()->get_connection(); 21 | }, 22 | ] 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Connection/WPWidgetCategories.php: -------------------------------------------------------------------------------- 1 | 'WPWidgetCategories', 14 | 'toType' => 'Category', 15 | 'fromFieldName' => 'rendered', 16 | 'resolve' => function ( $widget, $args, $context, $info ) { 17 | return DataSource::resolve_term_objects_connection($widget, $args, $context, $info, 'category'); 18 | }, 19 | ] 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Connection/WPWidgetPages.php: -------------------------------------------------------------------------------- 1 | 'WPWidgetPages', 14 | 'toType' => 'Page', 15 | 'fromFieldName' => 'rendered', 16 | 'resolve' => function ( $widget, $args, $context, $info ) { 17 | $resolver = new PostObjectConnectionResolver( $widget, $args, $context, $info, 'page' ); 18 | switch ($widget->sortby) { 19 | case 'post_title': 20 | $resolver->set_query_arg( 'orderby', 'title' ); 21 | break; 22 | case 'menu_order': 23 | $resolver->set_query_arg( 'orderby', 'menu_order' ); 24 | break; 25 | default: 26 | $resolver->set_query_arg( 'orderby', 'ID' ); 27 | } 28 | 29 | if (!empty($widget->exclude)) { 30 | $resolver->set_query_arg( 'post__not_in', explode(',', $widget->exclude) ); 31 | } 32 | 33 | return $resolver->get_connection(); 34 | }, 35 | ] 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Connection/WPWidgetRecentComments.php: -------------------------------------------------------------------------------- 1 | 'WPWidgetRecentComments', 14 | 'toType' => 'Comment', 15 | 'fromFieldName' => 'rendered', 16 | 'resolve' => function ( $widget, $args, $context, $info ) { 17 | $args['orderby'] = 'COMMENT_DATE'; 18 | $args['order'] = 'DESC'; 19 | $args['first'] = absint($widget->number); 20 | 21 | return DataSource::resolve_comments_connection($widget, $args, $context, $info); 22 | }, 23 | ] 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Connection/WPWidgetRecentPosts.php: -------------------------------------------------------------------------------- 1 | 'WPWidgetRecentPosts', 14 | 'toType' => 'Post', 15 | 'fromFieldName' => 'rendered', 16 | 'resolve' => function ( $widget, $args, $context, $info ) { 17 | $args['orderby'] = 'DATE'; 18 | $args['order'] = 'DESC'; 19 | $args['first'] = absint($widget->number); 20 | 21 | return DataSource::resolve_post_objects_connection($widget, $args, $context, $info, 'post'); 22 | }, 23 | ] 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Connection/WidgetInterface.php: -------------------------------------------------------------------------------- 1 | 'RootQuery', 13 | 'toType' => 'WidgetInterface', 14 | 'fromFieldName' => 'widgets', 15 | 'connectionArgs' => [ 16 | 'sidebar' => [ 17 | 'type' => 'SidebarEnum' 18 | ], 19 | ], 20 | 'resolve' => function ( $root, $args, $context, $info ) { 21 | $resolver = new WidgetConnectionResolver($root, $args, $context, $info); 22 | return $resolver->get_connection(); 23 | } 24 | ] 25 | ); 26 | 27 | register_graphql_connection( 28 | [ 29 | 'fromType' => 'Sidebar', 30 | 'toType' => 'WidgetInterface', 31 | 'fromFieldName' => 'widgets', 32 | 'resolve' => function ( $sidebar, $args, $context, $info ) { 33 | $resolver = new WidgetConnectionResolver($sidebar, $args, $context, $info); 34 | $resolver->set_query_arg('sidebar', $sidebar->databaseId); 35 | 36 | return $resolver->get_connection(); 37 | }, 38 | ] 39 | ); 40 | } 41 | } -------------------------------------------------------------------------------- /src/Data/Loader/SidebarLoader.php: -------------------------------------------------------------------------------- 1 | getSidebars(); 19 | $loaded = []; 20 | 21 | if (!is_array($sidebars) || empty($sidebars) ) { 22 | return $loaded; 23 | } 24 | 25 | foreach ( $keys as $key ) { 26 | $loaded[ $key ] = null; 27 | 28 | if (isset($sidebars[$key])) { 29 | $loaded[$key] = $sidebars[$key]; 30 | } 31 | } 32 | 33 | return $loaded; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Data/Loader/WidgetLoader.php: -------------------------------------------------------------------------------- 1 | getWidgets(); 20 | $loaded = []; 21 | 22 | if (!is_array($widgets) || empty($widgets) ) { 23 | return $loaded; 24 | } 25 | 26 | foreach ( $keys as $key ) { 27 | $loaded[ $key ] = null; 28 | 29 | if (isset($widgets[$key])) { 30 | $loaded[$key] = $widgets[$key]; 31 | } 32 | } 33 | 34 | return $loaded; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Model/Sidebar.php: -------------------------------------------------------------------------------- 1 | key = $key; 25 | $this->data = $sidebar; 26 | 27 | parent::__construct(); 28 | } 29 | 30 | protected function init() 31 | { 32 | if (empty($this->fields) ) { 33 | foreach ($this->data as $key => $value) { 34 | $this->fields[\graphql_format_field_name($key)] = $value; 35 | } 36 | 37 | $this->fields = array_merge( 38 | $this->fields, 39 | [ 40 | 'id' => function () { 41 | return ( ! empty($this->key) ) ? Relay::toGlobalId('Sidebar', $this->key) : null; 42 | }, 43 | 'databaseId' => function () { 44 | return ( ! empty($this->key) ) ? $this->key : null; 45 | } 46 | ] 47 | ); 48 | } 49 | } 50 | 51 | protected function is_private() 52 | { 53 | return $this->key === 'wp_inactive_widgets' && !current_user_can('edit_theme_options'); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Type/Enum/SidebarEnum.php: -------------------------------------------------------------------------------- 1 | getSidebars(); 12 | $values = []; 13 | 14 | foreach ($sidebars as $id => $sidebar) { 15 | $replacedKey = preg_replace('/[^_A-Za-z0-9]/i', '', str_replace(' ', '_', $sidebar['name'])); 16 | $values[strtoupper($replacedKey)] = $id; 17 | } 18 | 19 | register_graphql_enum_type( 20 | 'SidebarEnum', 21 | [ 22 | 'description' => __('Sidebar'), 23 | 'values' => $values 24 | ] 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Type/Widget.php: -------------------------------------------------------------------------------- 1 | 'WidgetUnion', 13 | 'fields' => [ 14 | 'id' => [ 15 | 'description' => __('Unique identifier for the object.'), 16 | 'type' => 'String', 17 | ], 18 | 'type' => [ 19 | 'description' => __('Type of Widget for the object.'), 20 | 'type' => 'String', 21 | ], 22 | 'title' => [ 23 | 'description' => __('The title for the object.'), 24 | 'type' => 'String', 25 | ], 26 | ], 27 | ] 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Type/WidgetTypes.php: -------------------------------------------------------------------------------- 1 | getWidgetTypeSettings(); 12 | 13 | foreach ($widgets as $name => $fields) { 14 | if (! is_array($fields)) { 15 | continue; 16 | } 17 | 18 | $config = []; 19 | 20 | foreach ($fields as $key => $field) { 21 | $config['fields'][\graphql_format_field_name($key)] = [ 22 | 'type' => self::getFieldType($field), 23 | ]; 24 | } 25 | 26 | 27 | Registry::init()->registerWidgetType($name, $config); 28 | } 29 | } 30 | 31 | private static function getFieldType($field) 32 | { 33 | switch(gettype($field)) { 34 | 35 | case 'string': 36 | return 'String'; 37 | break; 38 | 39 | case 'integer': 40 | return 'Int'; 41 | break; 42 | 43 | case 'double': 44 | return 'Float'; 45 | break; 46 | 47 | case 'boolean': 48 | return 'Boolean'; 49 | break; 50 | 51 | default: 52 | return null; 53 | 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/ivome/graphql-relay-php/src/Connection/ArrayConnection.php', 10 | 'GraphQLRelay\\Connection\\Connection' => $vendorDir . '/ivome/graphql-relay-php/src/Connection/Connection.php', 11 | 'GraphQLRelay\\Mutation\\Mutation' => $vendorDir . '/ivome/graphql-relay-php/src/Mutation/Mutation.php', 12 | 'GraphQLRelay\\Node\\Node' => $vendorDir . '/ivome/graphql-relay-php/src/Node/Node.php', 13 | 'GraphQLRelay\\Node\\Plural' => $vendorDir . '/ivome/graphql-relay-php/src/Node/Plural.php', 14 | 'GraphQLRelay\\Relay' => $vendorDir . '/ivome/graphql-relay-php/src/Relay.php', 15 | ); 16 | -------------------------------------------------------------------------------- /vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/wp-graphql/wp-graphql/access-functions.php', 10 | 'f23fb2f3f8f0b37aeaa2e54bba971cf2' => $vendorDir . '/wp-graphql/wp-graphql/activation.php', 11 | '041a301cb7808aeb8a9086a5113fbadc' => $vendorDir . '/wp-graphql/wp-graphql/deactivation.php', 12 | 'e98de5317c80bd3ca62f99d3754aff69' => $baseDir . '/functions.php', 13 | ); 14 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/wp-graphql/wp-graphql/src'), 10 | 'WPGraphQLWidgets\\' => array($baseDir . '/src'), 11 | 'GraphQL\\' => array($vendorDir . '/webonyx/graphql-php/src'), 12 | ); 13 | -------------------------------------------------------------------------------- /vendor/ivome/graphql-relay-php/.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | /composer.phar 3 | /composer.lock 4 | /vendor/ 5 | /bin/ 6 | /build/ 7 | /.phpunit.result.cache 8 | -------------------------------------------------------------------------------- /vendor/ivome/graphql-relay-php/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.1 5 | - 7.2 6 | - 7.3 7 | - 7.4 8 | - 8.0 9 | - nightly 10 | 11 | install: 12 | - composer install --prefer-dist 13 | 14 | script: 15 | - mkdir -p build/logs 16 | - ./bin/phpunit --coverage-clover build/logs/clover.xml tests/ 17 | 18 | after_script: 19 | - ./bin/coveralls -v 20 | -------------------------------------------------------------------------------- /vendor/ivome/graphql-relay-php/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2018, Ivo Meißner 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /vendor/ivome/graphql-relay-php/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ivome/graphql-relay-php", 3 | "description": "A PHP port of GraphQL Relay reference implementation", 4 | "type": "library", 5 | "license": "BSD-3-Clause", 6 | "homepage": "https://github.com/ivome/graphql-relay-php", 7 | "keywords": [ 8 | "graphql", 9 | "relay", 10 | "API" 11 | ], 12 | "require": { 13 | "php": "^7.1 || ^8.0", 14 | "webonyx/graphql-php": "^14.0" 15 | }, 16 | "require-dev": { 17 | "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", 18 | "satooshi/php-coveralls": "~1.0" 19 | }, 20 | "config": { 21 | "bin-dir": "bin" 22 | }, 23 | "autoload": { 24 | "classmap": [ 25 | "src/" 26 | ] 27 | }, 28 | "autoload-dev": { 29 | "classmap": [ 30 | "tests/" 31 | ], 32 | "files": [ 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/ivome/graphql-relay-php/contributors.txt: -------------------------------------------------------------------------------- 1 | Ivo Meißner 2 | -------------------------------------------------------------------------------- /vendor/ivome/graphql-relay-php/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | tests 5 | 6 | 7 | 8 | 9 | src 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /vendor/ivome/graphql-relay-php/tests/StarWarsMutationTest.php: -------------------------------------------------------------------------------- 1 | 33 | array ( 34 | 'shipName' => 'B-Wing', 35 | 'factionId' => '1', 36 | 'clientMutationId' => 'abcde', 37 | ), 38 | ); 39 | 40 | $expected = array ( 41 | 'introduceShip' => 42 | array ( 43 | 'ship' => 44 | array ( 45 | 'id' => 'U2hpcDo5', 46 | 'name' => 'B-Wing', 47 | ), 48 | 'faction' => 49 | array ( 50 | 'name' => 'Alliance to Restore the Republic', 51 | ), 52 | 'clientMutationId' => 'abcde', 53 | ), 54 | ); 55 | 56 | $result = GraphQL::executeQuery(StarWarsSchema::getSchema(), $mutation, null, null, $params)->toArray(); 57 | 58 | $this->assertEquals(['data' => $expected], $result); 59 | } 60 | } -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/.coveralls.yml: -------------------------------------------------------------------------------- 1 | coverage_clover: /tmp/coverage/*.xml 2 | json_path: /tmp/coverage/coverage.json 3 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | open_collective: webonyx-graphql-php 3 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2015-present, Webonyx, LLC. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webonyx/graphql-php", 3 | "description": "A PHP port of GraphQL reference implementation", 4 | "type": "library", 5 | "license": "MIT", 6 | "homepage": "https://github.com/webonyx/graphql-php", 7 | "keywords": [ 8 | "graphql", 9 | "API" 10 | ], 11 | "require": { 12 | "php": "^7.1||^8.0", 13 | "ext-json": "*", 14 | "ext-mbstring": "*" 15 | }, 16 | "require-dev": { 17 | "amphp/amp": "^2.3", 18 | "doctrine/coding-standard": "^6.0", 19 | "nyholm/psr7": "^1.2", 20 | "phpbench/phpbench": "^0.16.10", 21 | "phpstan/extension-installer": "^1.0", 22 | "phpstan/phpstan": "0.12.82", 23 | "phpstan/phpstan-phpunit": "0.12.18", 24 | "phpstan/phpstan-strict-rules": "0.12.9", 25 | "phpunit/phpunit": "^7.2|^8.5", 26 | "psr/http-message": "^1.0", 27 | "react/promise": "2.*", 28 | "simpod/php-coveralls-mirror": "^3.0", 29 | "squizlabs/php_codesniffer": "3.5.4" 30 | }, 31 | "config": { 32 | "preferred-install": "dist", 33 | "sort-packages": true 34 | }, 35 | "autoload": { 36 | "psr-4": { 37 | "GraphQL\\": "src/" 38 | } 39 | }, 40 | "autoload-dev": { 41 | "psr-4": { 42 | "GraphQL\\Tests\\": "tests/", 43 | "GraphQL\\Benchmarks\\": "benchmarks/", 44 | "GraphQL\\Examples\\Blog\\": "examples/01-blog/Blog/" 45 | } 46 | }, 47 | "suggest": { 48 | "react/promise": "To leverage async resolving on React PHP platform", 49 | "psr/http-message": "To use standard GraphQL server" 50 | }, 51 | "scripts": { 52 | "api-docs": "php tools/gendocs.php", 53 | "bench": "phpbench run .", 54 | "test": "phpunit", 55 | "lint" : "phpcs", 56 | "fix" : "phpcbf", 57 | "stan": "phpstan --ansi", 58 | "baseline": "phpstan --ansi --generate-baseline", 59 | "check": "composer lint && composer stan && composer test" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/docs/best-practices.md: -------------------------------------------------------------------------------- 1 | # Type Registry 2 | **graphql-php** expects that each type in Schema is presented by single instance. Therefore 3 | if you define your types as separate PHP classes you need to ensure that each type is referenced only once. 4 | 5 | Technically you can create several instances of your type (for example for tests), but `GraphQL\Type\Schema` 6 | will throw on attempt to add different instances with the same name. 7 | 8 | There are several ways to achieve this depending on your preferences. We provide reference 9 | implementation below that introduces TypeRegistry class: 10 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/docs/how-it-works.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | Following reading describes implementation details of query execution process. It may clarify some 3 | internals of GraphQL runtime but is not required to use it. 4 | 5 | # Parsing 6 | 7 | TODOC 8 | 9 | # Validating 10 | TODOC 11 | 12 | # Executing 13 | TODOC 14 | 15 | # Errors explained 16 | There are 3 types of errors in GraphQL: 17 | 18 | - **Syntax**: query has invalid syntax and could not be parsed; 19 | - **Validation**: query is incompatible with type system (e.g. unknown field is requested); 20 | - **Execution**: occurs when some field resolver throws (or returns unexpected value). 21 | 22 | Obviously, when **Syntax** or **Validation** error is detected - the process is interrupted and 23 | the query is not executed. 24 | 25 | Execution process never throws exceptions. Instead, all errors are caught and collected in 26 | execution result. 27 | 28 | GraphQL is forgiving to **Execution** errors which occur in resolvers of nullable fields. 29 | If such field throws or returns unexpected value the value of the field in response will be simply 30 | replaced with **null** and error entry will be registered. 31 | 32 | If an exception is thrown in the non-null field - error bubbles up to the first nullable field. 33 | This nullable field is replaced with **null** and error entry is added to the result. 34 | If all fields up to the root are non-null - **data** entry will be removed from the result 35 | and only **errors** key will be presented. 36 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/docs/type-system/unions.md: -------------------------------------------------------------------------------- 1 | # Union Type Definition 2 | A Union is an abstract type that simply enumerates other Object Types. 3 | The value of Union Type is actually a value of one of included Object Types. 4 | 5 | In **graphql-php** union type is an instance of `GraphQL\Type\Definition\UnionType` 6 | (or one of its subclasses) which accepts configuration array in a constructor: 7 | 8 | ```php 9 | 'SearchResult', 14 | 'types' => [ 15 | MyTypes::story(), 16 | MyTypes::user() 17 | ], 18 | 'resolveType' => function($value) { 19 | if ($value->type === 'story') { 20 | return MyTypes::story(); 21 | } else { 22 | return MyTypes::user(); 23 | } 24 | } 25 | ]); 26 | ``` 27 | 28 | This example uses **inline** style for Union definition, but you can also use 29 | [inheritance or type language](index.md#type-definition-styles). 30 | 31 | # Configuration options 32 | The constructor of UnionType accepts an array. Below is a full list of allowed options: 33 | 34 | Option | Type | Notes 35 | ------ | ---- | ----- 36 | name | `string` | **Required.** Unique name of this interface type within Schema 37 | types | `array` | **Required.** List of Object Types included in this Union. Note that you can't create a Union type out of Interfaces or other Unions. 38 | description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) 39 | resolveType | `callback` | **function($value, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Receives **$value** from resolver of the parent field and returns concrete Object Type for this **$value**. 40 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Deferred.php: -------------------------------------------------------------------------------- 1 | adapter = $adapter; 30 | $this->adoptedPromise = $adoptedPromise; 31 | } 32 | 33 | /** 34 | * @return Promise 35 | */ 36 | public function then(?callable $onFulfilled = null, ?callable $onRejected = null) 37 | { 38 | return $this->adapter->then($this, $onFulfilled, $onRejected); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php: -------------------------------------------------------------------------------- 1 | shared = $shared; 51 | $this->type = $type; 52 | $this->value = $value; 53 | $this->result = $result; 54 | $this->path = $path; 55 | $this->nullFence = $nullFence; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php: -------------------------------------------------------------------------------- 1 | fieldNodes = $fieldNodes; 58 | $this->fieldName = $fieldName; 59 | $this->resultName = $resultName; 60 | $this->argumentValueMap = $argumentValueMap; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Experimental/Executor/Runtime.php: -------------------------------------------------------------------------------- 1 | current = $coroutine; 32 | $this->stack = []; 33 | $this->depth = 0; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/ArgumentNode.php: -------------------------------------------------------------------------------- 1 | */ 19 | public $arguments; 20 | 21 | /** @var bool */ 22 | public $repeatable; 23 | 24 | /** @var NodeList */ 25 | public $locations; 26 | } 27 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/DirectiveNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $arguments; 17 | } 18 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/DocumentNode.php: -------------------------------------------------------------------------------- 1 | */ 13 | public $definitions; 14 | } 15 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var NodeList */ 19 | public $values; 20 | 21 | /** @var StringValueNode|null */ 22 | public $description; 23 | } 24 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var NodeList */ 19 | public $values; 20 | } 21 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var StringValueNode|null */ 19 | public $description; 20 | } 21 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/EnumValueNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $arguments; 17 | 18 | /** @var NamedTypeNode|ListTypeNode|NonNullTypeNode */ 19 | public $type; 20 | 21 | /** @var NodeList */ 22 | public $directives; 23 | 24 | /** @var StringValueNode|null */ 25 | public $description; 26 | } 27 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/FieldNode.php: -------------------------------------------------------------------------------- 1 | */ 19 | public $arguments; 20 | 21 | /** @var NodeList */ 22 | public $directives; 23 | 24 | /** @var SelectionSetNode|null */ 25 | public $selectionSet; 26 | } 27 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/FloatValueNode.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | public $variableDefinitions; 22 | 23 | /** @var NamedTypeNode */ 24 | public $typeCondition; 25 | 26 | /** @var NodeList */ 27 | public $directives; 28 | 29 | /** @var SelectionSetNode */ 30 | public $selectionSet; 31 | } 32 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | } 18 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var SelectionSetNode */ 19 | public $selectionSet; 20 | } 21 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var NodeList */ 19 | public $fields; 20 | 21 | /** @var StringValueNode|null */ 22 | public $description; 23 | } 24 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var NodeList */ 19 | public $fields; 20 | } 21 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php: -------------------------------------------------------------------------------- 1 | */ 22 | public $directives; 23 | 24 | /** @var StringValueNode|null */ 25 | public $description; 26 | } 27 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/IntValueNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var NodeList */ 19 | public $interfaces; 20 | 21 | /** @var NodeList */ 22 | public $fields; 23 | 24 | /** @var StringValueNode|null */ 25 | public $description; 26 | } 27 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var NodeList */ 19 | public $interfaces; 20 | 21 | /** @var NodeList */ 22 | public $fields; 23 | } 24 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/ListTypeNode.php: -------------------------------------------------------------------------------- 1 | */ 13 | public $values; 14 | } 15 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/Location.php: -------------------------------------------------------------------------------- 1 | start = $start; 61 | $tmp->end = $end; 62 | 63 | return $tmp; 64 | } 65 | 66 | public function __construct(?Token $startToken = null, ?Token $endToken = null, ?Source $source = null) 67 | { 68 | $this->startToken = $startToken; 69 | $this->endToken = $endToken; 70 | $this->source = $source; 71 | 72 | if ($startToken === null || $endToken === null) { 73 | return; 74 | } 75 | 76 | $this->start = $startToken->start; 77 | $this->end = $endToken->end; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/NameNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $interfaces; 17 | 18 | /** @var NodeList */ 19 | public $directives; 20 | 21 | /** @var NodeList */ 22 | public $fields; 23 | 24 | /** @var StringValueNode|null */ 25 | public $description; 26 | } 27 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $interfaces; 17 | 18 | /** @var NodeList */ 19 | public $directives; 20 | 21 | /** @var NodeList */ 22 | public $fields; 23 | } 24 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php: -------------------------------------------------------------------------------- 1 | */ 13 | public $fields; 14 | } 15 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php: -------------------------------------------------------------------------------- 1 | */ 19 | public $variableDefinitions; 20 | 21 | /** @var NodeList */ 22 | public $directives; 23 | 24 | /** @var SelectionSetNode */ 25 | public $selectionSet; 26 | } 27 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var StringValueNode|null */ 19 | public $description; 20 | } 21 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | } 18 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php: -------------------------------------------------------------------------------- 1 | */ 13 | public $directives; 14 | 15 | /** @var NodeList */ 16 | public $operationTypes; 17 | } 18 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php: -------------------------------------------------------------------------------- 1 | */ 13 | public $directives; 14 | 15 | /** @var NodeList */ 16 | public $operationTypes; 17 | } 18 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/SelectionNode.php: -------------------------------------------------------------------------------- 1 | */ 13 | public $selections; 14 | } 15 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/StringValueNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var NodeList */ 19 | public $types; 20 | 21 | /** @var StringValueNode|null */ 22 | public $description; 23 | } 24 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php: -------------------------------------------------------------------------------- 1 | */ 16 | public $directives; 17 | 18 | /** @var NodeList */ 19 | public $types; 20 | } 21 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/ValueNode.php: -------------------------------------------------------------------------------- 1 | */ 22 | public $directives; 23 | } 24 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/AST/VariableNode.php: -------------------------------------------------------------------------------- 1 | line = $line; 24 | $this->column = $col; 25 | } 26 | 27 | /** 28 | * @return int[] 29 | */ 30 | public function toArray() 31 | { 32 | return [ 33 | 'line' => $this->line, 34 | 'column' => $this->column, 35 | ]; 36 | } 37 | 38 | /** 39 | * @return int[] 40 | */ 41 | public function toSerializableArray() 42 | { 43 | return $this->toArray(); 44 | } 45 | 46 | /** 47 | * @return int[] 48 | */ 49 | public function jsonSerialize() 50 | { 51 | return $this->toSerializableArray(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Language/VisitorOperation.php: -------------------------------------------------------------------------------- 1 | value; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Type/Definition/CompositeType.php: -------------------------------------------------------------------------------- 1 | name = $config['name'] ?? null; 35 | $this->value = $config['value'] ?? null; 36 | $this->deprecationReason = $config['deprecationReason'] ?? null; 37 | $this->description = $config['description'] ?? null; 38 | $this->astNode = $config['astNode'] ?? null; 39 | 40 | $this->config = $config; 41 | } 42 | 43 | /** 44 | * @return bool 45 | */ 46 | public function isDeprecated() 47 | { 48 | return (bool) $this->deprecationReason; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php: -------------------------------------------------------------------------------- 1 | 22 | * 23 | * @throws InvariantViolation 24 | */ 25 | public function getFields() : array; 26 | 27 | /** 28 | * @return array 29 | * 30 | * @throws InvariantViolation 31 | */ 32 | public function getFieldNames() : array; 33 | } 34 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Type/Definition/ImplementingType.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | public function getInterfaces() : array; 20 | } 21 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Type/Definition/InputType.php: -------------------------------------------------------------------------------- 1 | 13 | | NonNull< 14 | | ScalarType 15 | | EnumType 16 | | InputObjectType 17 | | ListOfType, 18 | >; 19 | */ 20 | interface InputType 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Type/Definition/LeafType.php: -------------------------------------------------------------------------------- 1 | ofType = is_callable($type) ? $type : Type::assertType($type); 21 | } 22 | 23 | public function toString() : string 24 | { 25 | return '[' . $this->getOfType()->toString() . ']'; 26 | } 27 | 28 | public function getOfType() 29 | { 30 | return Schema::resolveType($this->ofType); 31 | } 32 | 33 | public function getWrappedType(bool $recurse = false) : Type 34 | { 35 | $type = $this->getOfType(); 36 | 37 | return $recurse && $type instanceof WrappingType 38 | ? $type->getWrappedType($recurse) 39 | : $type; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Type/Definition/NamedType.php: -------------------------------------------------------------------------------- 1 | ofType = $type; 22 | } 23 | 24 | public function toString() : string 25 | { 26 | return $this->getWrappedType()->toString() . '!'; 27 | } 28 | 29 | public function getOfType() 30 | { 31 | return Schema::resolveType($this->ofType); 32 | } 33 | 34 | /** 35 | * @return (NullableType&Type) 36 | */ 37 | public function getWrappedType(bool $recurse = false) : Type 38 | { 39 | $type = $this->getOfType(); 40 | 41 | return $recurse && $type instanceof WrappingType 42 | ? $type->getWrappedType($recurse) 43 | : $type; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Type/Definition/NullableType.php: -------------------------------------------------------------------------------- 1 | ; 16 | */ 17 | 18 | interface NullableType 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Type/Definition/OutputType.php: -------------------------------------------------------------------------------- 1 | name = $config['name'] ?? $this->tryInferName(); 44 | $this->description = $config['description'] ?? $this->description; 45 | $this->astNode = $config['astNode'] ?? null; 46 | $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; 47 | $this->config = $config; 48 | 49 | Utils::invariant(is_string($this->name), 'Must provide name.'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php: -------------------------------------------------------------------------------- 1 | */ 18 | private $objects; 19 | 20 | /** @var array */ 21 | private $interfaces; 22 | 23 | /** 24 | * @param array $objects 25 | * @param array $interfaces 26 | */ 27 | public function __construct(array $objects, array $interfaces) 28 | { 29 | $this->objects = $objects; 30 | $this->interfaces = $interfaces; 31 | } 32 | 33 | /** 34 | * @return array 35 | */ 36 | public function objects() : array 37 | { 38 | return $this->objects; 39 | } 40 | 41 | /** 42 | * @return array 43 | */ 44 | public function interfaces() : array 45 | { 46 | return $this->interfaces; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Utils/PairSet.php: -------------------------------------------------------------------------------- 1 | data = []; 19 | } 20 | 21 | /** 22 | * @param string $a 23 | * @param string $b 24 | * @param bool $areMutuallyExclusive 25 | * 26 | * @return bool 27 | */ 28 | public function has($a, $b, $areMutuallyExclusive) 29 | { 30 | $first = $this->data[$a] ?? null; 31 | $result = $first && isset($first[$b]) ? $first[$b] : null; 32 | if ($result === null) { 33 | return false; 34 | } 35 | // areMutuallyExclusive being false is a superset of being true, 36 | // hence if we want to know if this PairSet "has" these two with no 37 | // exclusivity, we have to ensure it was added as such. 38 | if ($areMutuallyExclusive === false) { 39 | return $result === false; 40 | } 41 | 42 | return true; 43 | } 44 | 45 | /** 46 | * @param string $a 47 | * @param string $b 48 | * @param bool $areMutuallyExclusive 49 | */ 50 | public function add($a, $b, $areMutuallyExclusive) 51 | { 52 | $this->pairSetAdd($a, $b, $areMutuallyExclusive); 53 | $this->pairSetAdd($b, $a, $areMutuallyExclusive); 54 | } 55 | 56 | /** 57 | * @param string $a 58 | * @param string $b 59 | * @param bool $areMutuallyExclusive 60 | */ 61 | private function pairSetAdd($a, $b, $areMutuallyExclusive) 62 | { 63 | $this->data[$a] = $this->data[$a] ?? []; 64 | $this->data[$a][$b] = $areMutuallyExclusive; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/ASTValidationContext.php: -------------------------------------------------------------------------------- 1 | ast = $ast; 25 | $this->schema = $schema; 26 | $this->errors = []; 27 | } 28 | 29 | public function reportError(Error $error) 30 | { 31 | $this->errors[] = $error; 32 | } 33 | 34 | /** 35 | * @return Error[] 36 | */ 37 | public function getErrors() 38 | { 39 | return $this->errors; 40 | } 41 | 42 | /** 43 | * @return DocumentNode 44 | */ 45 | public function getDocument() 46 | { 47 | return $this->ast; 48 | } 49 | 50 | public function getSchema() : ?Schema 51 | { 52 | return $this->schema; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php: -------------------------------------------------------------------------------- 1 | name = $name; 18 | $this->visitorFn = $visitorFn; 19 | } 20 | 21 | /** 22 | * @return Error[] 23 | */ 24 | public function getVisitor(ValidationContext $context) 25 | { 26 | $fn = $this->visitorFn; 27 | 28 | return $fn($context); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php: -------------------------------------------------------------------------------- 1 | setEnabled($enabled); 22 | } 23 | 24 | public function setEnabled($enabled) 25 | { 26 | $this->isEnabled = $enabled; 27 | } 28 | 29 | public function getVisitor(ValidationContext $context) 30 | { 31 | return $this->invokeIfNeeded( 32 | $context, 33 | [ 34 | NodeKind::FIELD => static function (FieldNode $node) use ($context) : void { 35 | if ($node->name->value !== '__type' && $node->name->value !== '__schema') { 36 | return; 37 | } 38 | 39 | $context->reportError(new Error( 40 | static::introspectionDisabledMessage(), 41 | [$node] 42 | )); 43 | }, 44 | ] 45 | ); 46 | } 47 | 48 | public static function introspectionDisabledMessage() 49 | { 50 | return 'GraphQL introspection is not allowed, but the query contained __schema or __type'; 51 | } 52 | 53 | protected function isEnabled() 54 | { 55 | return $this->isEnabled !== self::DISABLED; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php: -------------------------------------------------------------------------------- 1 | static function (DocumentNode $node) use ($context) : VisitorOperation { 29 | /** @var ExecutableDefinitionNode|TypeSystemDefinitionNode $definition */ 30 | foreach ($node->definitions as $definition) { 31 | if ($definition instanceof ExecutableDefinitionNode) { 32 | continue; 33 | } 34 | 35 | $context->reportError(new Error( 36 | self::nonExecutableDefinitionMessage($definition->name->value), 37 | [$definition->name] 38 | )); 39 | } 40 | 41 | return Visitor::skipNode(); 42 | }, 43 | ]; 44 | } 45 | 46 | public static function nonExecutableDefinitionMessage($defName) 47 | { 48 | return sprintf('The "%s" definition is not executable.', $defName); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php: -------------------------------------------------------------------------------- 1 | static function (FragmentSpreadNode $node) use ($context) : void { 19 | $fragmentName = $node->name->value; 20 | $fragment = $context->getFragment($fragmentName); 21 | if ($fragment) { 22 | return; 23 | } 24 | 25 | $context->reportError(new Error( 26 | self::unknownFragmentMessage($fragmentName), 27 | [$node->name] 28 | )); 29 | }, 30 | ]; 31 | } 32 | 33 | /** 34 | * @param string $fragName 35 | */ 36 | public static function unknownFragmentMessage($fragName) 37 | { 38 | return sprintf('Unknown fragment "%s".', $fragName); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php: -------------------------------------------------------------------------------- 1 | static function (FieldNode $node) use ($context) : void { 20 | $type = $context->getType(); 21 | if (! $type) { 22 | return; 23 | } 24 | 25 | if (Type::isLeafType(Type::getNamedType($type))) { 26 | if ($node->selectionSet) { 27 | $context->reportError(new Error( 28 | self::noSubselectionAllowedMessage($node->name->value, $type), 29 | [$node->selectionSet] 30 | )); 31 | } 32 | } elseif (! $node->selectionSet) { 33 | $context->reportError(new Error( 34 | self::requiredSubselectionMessage($node->name->value, $type), 35 | [$node] 36 | )); 37 | } 38 | }, 39 | ]; 40 | } 41 | 42 | public static function noSubselectionAllowedMessage($field, $type) 43 | { 44 | return sprintf('Field "%s" of type "%s" must not have a sub selection.', $field, $type); 45 | } 46 | 47 | public static function requiredSubselectionMessage($field, $type) 48 | { 49 | return sprintf('Field "%s" of type "%s" must have a sub selection.', $field, $type); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php: -------------------------------------------------------------------------------- 1 | knownFragmentNames = []; 24 | 25 | return [ 26 | NodeKind::OPERATION_DEFINITION => static function () : VisitorOperation { 27 | return Visitor::skipNode(); 28 | }, 29 | NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) : VisitorOperation { 30 | $fragmentName = $node->name->value; 31 | if (! isset($this->knownFragmentNames[$fragmentName])) { 32 | $this->knownFragmentNames[$fragmentName] = $node->name; 33 | } else { 34 | $context->reportError(new Error( 35 | self::duplicateFragmentNameMessage($fragmentName), 36 | [$this->knownFragmentNames[$fragmentName], $node->name] 37 | )); 38 | } 39 | 40 | return Visitor::skipNode(); 41 | }, 42 | ]; 43 | } 44 | 45 | public static function duplicateFragmentNameMessage($fragName) 46 | { 47 | return sprintf('There can be only one fragment named "%s".', $fragName); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php: -------------------------------------------------------------------------------- 1 | knownVariableNames = []; 22 | 23 | return [ 24 | NodeKind::OPERATION_DEFINITION => function () : void { 25 | $this->knownVariableNames = []; 26 | }, 27 | NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $node) use ($context) : void { 28 | $variableName = $node->variable->name->value; 29 | if (! isset($this->knownVariableNames[$variableName])) { 30 | $this->knownVariableNames[$variableName] = $node->variable->name; 31 | } else { 32 | $context->reportError(new Error( 33 | self::duplicateVariableMessage($variableName), 34 | [$this->knownVariableNames[$variableName], $node->variable->name] 35 | )); 36 | } 37 | }, 38 | ]; 39 | } 40 | 41 | public static function duplicateVariableMessage($variableName) 42 | { 43 | return sprintf('There can be only one variable named "%s".', $variableName); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php: -------------------------------------------------------------------------------- 1 | name === '' || $this->name === null ? static::class : $this->name; 19 | } 20 | 21 | public function __invoke(ValidationContext $context) 22 | { 23 | return $this->getVisitor($context); 24 | } 25 | 26 | /** 27 | * Returns structure suitable for GraphQL\Language\Visitor 28 | * 29 | * @see \GraphQL\Language\Visitor 30 | * 31 | * @return mixed[] 32 | */ 33 | public function getVisitor(ValidationContext $context) 34 | { 35 | return []; 36 | } 37 | 38 | /** 39 | * Returns structure suitable for GraphQL\Language\Visitor 40 | * 41 | * @see \GraphQL\Language\Visitor 42 | * 43 | * @return mixed[] 44 | */ 45 | public function getSDLVisitor(SDLValidationContext $context) 46 | { 47 | return []; 48 | } 49 | } 50 | 51 | class_alias(ValidationRule::class, 'GraphQL\Validator\Rules\AbstractValidationRule'); 52 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php: -------------------------------------------------------------------------------- 1 | static function (VariableDefinitionNode $node) use ($context) : void { 22 | $type = TypeInfo::typeFromAST($context->getSchema(), $node->type); 23 | 24 | // If the variable type is not an input type, return an error. 25 | if (! $type || Type::isInputType($type)) { 26 | return; 27 | } 28 | 29 | $variableName = $node->variable->name->value; 30 | $context->reportError(new Error( 31 | self::nonInputTypeOnVarMessage($variableName, Printer::doPrint($node->type)), 32 | [$node->type] 33 | )); 34 | }, 35 | ]; 36 | } 37 | 38 | public static function nonInputTypeOnVarMessage($variableName, $typeName) 39 | { 40 | return sprintf('Variable "$%s" cannot be non-input type "%s".', $variableName, $typeName); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/webonyx/graphql-php/src/Validator/SDLValidationContext.php: -------------------------------------------------------------------------------- 1 | init(); 38 | $settings->register_settings(); 39 | 40 | // Get all the registered settings fields 41 | $fields = $settings->settings_api->get_settings_fields(); 42 | 43 | // Loop over the registered settings fields and delete the options 44 | if ( ! empty( $fields ) && is_array( $fields ) ) { 45 | foreach ( $fields as $group => $fields ) { 46 | delete_option( $group ); 47 | } 48 | } 49 | 50 | do_action( 'graphql_delete_data' ); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wp-graphql", 3 | "version": "0.3.6", 4 | "description": "GraphQL API for WordPress", 5 | "main": "index.js", 6 | "directories": { 7 | "doc": "docs", 8 | "test": "tests" 9 | }, 10 | "scripts": { 11 | "test": "echo \"Error: no test specified\" && exit 1" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/wp-graphql/wp-graphql.git" 16 | }, 17 | "keywords": [ 18 | "WordPress", 19 | "GraphQL" 20 | ], 21 | "author": "WPGraphQL", 22 | "license": "GPL-3.0", 23 | "bugs": { 24 | "url": "https://github.com/wp-graphql/wp-graphql/issues" 25 | }, 26 | "homepage": "https://github.com/wp-graphql/wp-graphql#readme", 27 | "devDependencies": { 28 | "husky": "^3.0.9", 29 | "lint-staged": "^9.4.2" 30 | }, 31 | "lint-staged": { 32 | "*.php": "composer run check-cs" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/Admin.php: -------------------------------------------------------------------------------- 1 | admin_enabled = apply_filters( 'graphql_show_admin', true ); 44 | $this->graphiql_enabled = apply_filters( 'graphql_enable_graphiql', get_graphql_setting( 'graphiql_enabled', true ) ); 45 | 46 | // This removes the menu page for WPGraphiQL as it's now built into WPGraphQL 47 | if ( $this->graphiql_enabled ) { 48 | add_action( 'admin_menu', function () { 49 | remove_menu_page( 'wp-graphiql/wp-graphiql.php' ); 50 | } ); 51 | } 52 | 53 | // If the admin is disabled, prevent admin from being scaffolded. 54 | if ( false === $this->admin_enabled ) { 55 | return; 56 | } 57 | 58 | $this->settings = new Settings(); 59 | $this->settings->init(); 60 | 61 | if ( 'on' === $this->graphiql_enabled || true === $this->graphiql_enabled ) { 62 | $graphiql = new GraphiQL(); 63 | $graphiql->init(); 64 | } 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/README.md: -------------------------------------------------------------------------------- 1 | # GraphiQL IDE 2 | 3 | [GraphiQL IDE](https://github.com/graphql/graphiql) is a web based IDE interface for interacting with GraphQL APIs. 4 | 5 | This implementation is tailored to work specifically with WPGraphQL. 6 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/app/README.md: -------------------------------------------------------------------------------- 1 | # WPGraphiQL 2 | 3 | This is a React app built with Create React App and implementing: 4 | 5 | - GraphiQL 6 | - GraphiQL Explorer 7 | - GraphiQL Code Exporter 8 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/app/build/asset-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "main.css": "static/css/main.aafb6422.css", 3 | "main.css.map": "static/css/main.aafb6422.css.map", 4 | "main.js": "static/js/main.b7d08b5b.js", 5 | "main.js.map": "static/js/main.b7d08b5b.js.map", 6 | "static/media/GraphQLLanguageService.js.flow": "static/media/GraphQLLanguageService.js.5ab204b9.flow", 7 | "static/media/autocompleteUtils.js.flow": "static/media/autocompleteUtils.js.4ce7ba19.flow", 8 | "static/media/getAutocompleteSuggestions.js.flow": "static/media/getAutocompleteSuggestions.js.7f98f032.flow", 9 | "static/media/getDefinition.js.flow": "static/media/getDefinition.js.4dbec62f.flow", 10 | "static/media/getDiagnostics.js.flow": "static/media/getDiagnostics.js.65b0979a.flow", 11 | "static/media/getHoverInformation.js.flow": "static/media/getHoverInformation.js.d9411837.flow", 12 | "static/media/getOutline.js.flow": "static/media/getOutline.js.c04e3998.flow", 13 | "static/media/index.js.flow": "static/media/index.js.02c24280.flow" 14 | } -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/app/build/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/app/build/static/media/index.js.02c24280.flow: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | * 8 | * @flow 9 | */ 10 | 11 | export { 12 | getDefinitionState, 13 | getFieldDef, 14 | forEachState, 15 | objectValues, 16 | hintList, 17 | } from './autocompleteUtils'; 18 | 19 | export {getAutocompleteSuggestions} from './getAutocompleteSuggestions'; 20 | 21 | export { 22 | LANGUAGE, 23 | getDefinitionQueryResultForFragmentSpread, 24 | getDefinitionQueryResultForDefinitionNode, 25 | } from './getDefinition'; 26 | 27 | export {getDiagnostics, validateQuery} from './getDiagnostics'; 28 | export {getOutline} from './getOutline'; 29 | export {getHoverInformation} from './getHoverInformation'; 30 | 31 | export {GraphQLLanguageService} from './GraphQLLanguageService'; 32 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wp-graphiql", 3 | "description": "This plugin provides the GraphiQL IDE as an admin page in WordPress, allowing the GraphQL WPGraphQL schema to be browsed from within WordPress.", 4 | "author": "WPGraphQL, Digital First Media, Jason Bahl", 5 | "homepage": "http://wpgraphql.com", 6 | "bugs": { 7 | "url": "https://github.com/wp-graphql/wp-graphiql/issues" 8 | }, 9 | "version": "1.0.0", 10 | "private": true, 11 | "devDependencies": { 12 | "react-scripts": "^1.1.4" 13 | }, 14 | "dependencies": { 15 | "graphiql": "^0.13.2", 16 | "graphiql-code-exporter": "^2.0.5", 17 | "graphiql-explorer": "^0.4.3", 18 | "graphql": "^14.4.2", 19 | "react": "^16.8.6", 20 | "react-dom": "^16.8.6", 21 | "whatwg-fetch": "^3.0.0" 22 | }, 23 | "scripts": { 24 | "start": "react-scripts start", 25 | "build": "react-scripts build", 26 | "test": "react-scripts test --env=jsdom", 27 | "eject": "react-scripts eject" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/app/public/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benada002/wp-graphql-widgets/22fbddd6e6156a011a95fee4eb989c0b9dabb4f2/vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/app/public/index.html -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/app/src/app.css: -------------------------------------------------------------------------------- 1 | #wp-graphiql { 2 | display: flex; 3 | flex: 1; 4 | } 5 | 6 | #wp-graphiql .spinner{ 7 | visibility: visible; 8 | background: none; 9 | } 10 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/app/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render(, document.getElementById('graphiql')); 6 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/app/src/snippets.js: -------------------------------------------------------------------------------- 1 | const getQuery = (arg, spaceCount) => { 2 | const { operationDataList } = arg 3 | const { query } = operationDataList[0] 4 | const anonymousQuery = query.replace(/query\s.+{/gim, `{`) 5 | return ( 6 | ` `.repeat(spaceCount) + 7 | anonymousQuery.replace(/\n/g, `\n` + ` `.repeat(spaceCount)) 8 | ) 9 | } 10 | 11 | const pageQuery = { 12 | name: `Page query`, 13 | language: `Gatsby`, 14 | codeMirrorMode: `jsx`, 15 | options: [], 16 | generate: arg => `import React from "react" 17 | import { graphql } from "gatsby" 18 | 19 | const ComponentName = ({ data }) =>
{JSON.stringify(data, null, 4)}
20 | 21 | export const query = graphql\` 22 | ${getQuery(arg, 2)} 23 | \` 24 | 25 | export default ComponentName 26 | 27 | `, 28 | } 29 | 30 | const staticHook = { 31 | name: `StaticQuery hook`, 32 | language: `Gatsby`, 33 | codeMirrorMode: `jsx`, 34 | options: [], 35 | generate: arg => `import React from "react" 36 | import { useStaticQuery, graphql } from "gatsby" 37 | 38 | const ComponentName = () => { 39 | const data = useStaticQuery(graphql\` 40 | ${getQuery(arg, 4)} 41 | \`) 42 | return
{JSON.stringify(data, null, 4)}
43 | } 44 | 45 | export default ComponentName 46 | 47 | `, 48 | } 49 | 50 | const staticQuery = { 51 | name: `StaticQuery`, 52 | language: `Gatsby`, 53 | codeMirrorMode: `jsx`, 54 | options: [], 55 | generate: arg => `import React from "react" 56 | import { StaticQuery, graphql } from "gatsby" 57 | 58 | const ComponentName = () => ( 59 |
{JSON.stringify(data, null, 4)}
} 64 | >
65 | ) 66 | 67 | export default ComponentName 68 | 69 | `, 70 | } 71 | 72 | export default [pageQuery, staticHook, staticQuery] 73 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/GraphiQL/js/graphiql-helpers.js: -------------------------------------------------------------------------------- 1 | $j=jQuery.noConflict(); 2 | 3 | $j(document).ready(function(){ 4 | 5 | $j('.update-nag').hide(); 6 | $j('.error').hide(); 7 | 8 | $defaultHeight = '500px'; 9 | $wpWrapHeight = $j('#wpwrap').height(); 10 | $adminBarHeight = $j('#wpadminbar').height(); 11 | $footerHeight = $j('#wpfooter').height(); 12 | $height = ( $wpWrapHeight - $adminBarHeight - $footerHeight - 65 ); 13 | $graphiqlHeight = ( $defaultHeight < $height ) ? $defaultHeight : $height; 14 | $j('#graphiql').css( 'height', $graphiqlHeight ); 15 | }); 16 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Admin/README.md: -------------------------------------------------------------------------------- 1 | # WPGraphQL Admin 2 | 3 | This directory is intended to include admin UI such as WPGraphQL Settings pages, GraphiQL, etc. 4 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Connection/README.md: -------------------------------------------------------------------------------- 1 | # Connection 2 | 3 | This directory stores registrations of connections for the Schema. 4 | 5 | The filename represents the Type the connections are going TO. 6 | 7 | For example, `Comments.php` registers connections from other types TO the Comment type, such as RootQueryToCommentConnection and UserToCommentConnection 8 | 9 | Said registered connections enable queries like so: 10 | 11 | ### RootQueryToCommentConnection 12 | ``` 13 | { 14 | comments { 15 | edges { 16 | node { 17 | id 18 | content 19 | } 20 | } 21 | } 22 | } 23 | ``` 24 | 25 | ### UserToCommentConnection 26 | ``` 27 | { 28 | users { 29 | edges { 30 | node { 31 | comments { 32 | edges { 33 | node { 34 | id 35 | content 36 | } 37 | } 38 | } 39 | } 40 | } 41 | } 42 | } 43 | ``` -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Connection/Revisions.php: -------------------------------------------------------------------------------- 1 | 'RootQuery', 24 | 'toType' => 'ContentRevisionUnion', 25 | 'queryClass' => 'WP_Query', 26 | 'fromFieldName' => 'revisions', 27 | 'connectionArgs' => PostObjects::get_connection_args(), 28 | 'resolve' => function ( $root, $args, $context, $info ) { 29 | return DataSource::resolve_post_objects_connection( $root, $args, $context, $info, 'revision' ); 30 | }, 31 | ] 32 | ); 33 | 34 | register_graphql_connection( 35 | [ 36 | 'fromType' => 'User', 37 | 'toType' => 'ContentRevisionUnion', 38 | 'queryClass' => 'WP_Query', 39 | 'fromFieldName' => 'revisions', 40 | 'description' => __( 'Connection between the User and Revisions authored by the user', 'wp-graphql' ), 41 | 'connectionArgs' => PostObjects::get_connection_args(), 42 | 'resolve' => function ( $root, $args, $context, $info ) { 43 | return DataSource::resolve_post_objects_connection( $root, $args, $context, $info, 'revision' ); 44 | }, 45 | ] 46 | ); 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Data/Connection/MenuConnectionResolver.php: -------------------------------------------------------------------------------- 1 | false, 23 | 'include' => [], 24 | 'taxonomy' => 'nav_menu', 25 | 'fields' => 'ids', 26 | ]; 27 | 28 | if ( ! empty( $this->args['where']['slug'] ) ) { 29 | $term_args['slug'] = $this->args['where']['slug']; 30 | $term_args['include'] = null; 31 | } 32 | 33 | $theme_locations = get_nav_menu_locations(); 34 | 35 | // If a location is specified in the args, use it 36 | if ( ! empty( $this->args['where']['location'] ) ) { 37 | if ( isset( $theme_locations[ $this->args['where']['location'] ] ) ) { 38 | $term_args['include'] = $theme_locations[ $this->args['where']['location'] ]; 39 | } 40 | } else { 41 | // If the current user cannot edit theme options 42 | if ( ! current_user_can( 'edit_theme_options' ) ) { 43 | $term_args['include'] = array_values( $theme_locations ); 44 | } 45 | } 46 | 47 | if ( ! empty( $this->args['where']['id'] ) ) { 48 | $term_args['include'] = $this->args['where']['id']; 49 | } 50 | 51 | $query_args = parent::get_query_args(); 52 | 53 | return array_merge( $query_args, $term_args ); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Data/Loader/CommentAuthorLoader.php: -------------------------------------------------------------------------------- 1 | $keys, 42 | 'orderby' => 'comment__in', 43 | 'number' => count( $keys ), 44 | 'no_found_rows' => true, 45 | 'count' => false, 46 | ]; 47 | 48 | /** 49 | * Execute the query. Call get_comments() to add them to the cache. 50 | */ 51 | $query = new \WP_Comment_Query( $args ); 52 | $query->get_comments(); 53 | $loaded = []; 54 | foreach ( $keys as $key ) { 55 | $loaded[ $key ] = \WP_Comment::get_instance( $key ); 56 | } 57 | return $loaded; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Data/Loader/EnqueuedScriptLoader.php: -------------------------------------------------------------------------------- 1 | registered[ $key ] ) ) { 26 | $script = $wp_scripts->registered[ $key ]; 27 | $script->type = 'EnqueuedScript'; 28 | $loaded[ $key ] = $script; 29 | } else { 30 | $loaded[ $key ] = null; 31 | } 32 | } 33 | return $loaded; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Data/Loader/EnqueuedStylesheetLoader.php: -------------------------------------------------------------------------------- 1 | registered[ $key ] ) ) { 24 | $stylesheet = $wp_styles->registered[ $key ]; 25 | $stylesheet->type = 'EnqueuedStylesheet'; 26 | $loaded[ $key ] = $stylesheet; 27 | } else { 28 | $loaded[ $key ] = null; 29 | } 30 | } 31 | return $loaded; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Data/Loader/PluginLoader.php: -------------------------------------------------------------------------------- 1 | true ], 'objects' ); 33 | 34 | $loaded = []; 35 | if ( ! empty( $post_types ) && is_array( $post_types ) ) { 36 | foreach ( $keys as $key ) { 37 | if ( isset( $post_types[ $key ] ) ) { 38 | $loaded[ $key ] = $post_types[ $key ]; 39 | } else { 40 | $loaded[ $key ] = null; 41 | } 42 | } 43 | } 44 | 45 | return $loaded; 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Data/Loader/README.md: -------------------------------------------------------------------------------- 1 | # Data Loaders 2 | 3 | This directory contains classes related to data loading. 4 | 5 | The concept comes from the formal DataLoader library. 6 | 7 | WordPress already does some batching and caching, so implementing DataLoader straight 8 | up actually leads to _increased_ queries in WPGraphQL, so this approach 9 | makes use of some custom batch load functions and Deferred resolvers, provided 10 | by GraphQL-PHP to reduce the number of queries needed in many cases. 11 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Data/Loader/TaxonomyLoader.php: -------------------------------------------------------------------------------- 1 | true ], 'objects' ); 33 | 34 | $loaded = []; 35 | if ( ! empty( $taxonomies ) && is_array( $taxonomies ) ) { 36 | foreach ( $keys as $key ) { 37 | if ( isset( $taxonomies[ $key ] ) ) { 38 | $loaded[ $key ] = $taxonomies[ $key ]; 39 | } else { 40 | $loaded[ $key ] = null; 41 | } 42 | } 43 | } 44 | 45 | return $loaded; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Data/Loader/ThemeLoader.php: -------------------------------------------------------------------------------- 1 | get_stylesheet(); 43 | $theme = wp_get_theme( $stylesheet ); 44 | if ( $theme->exists() ) { 45 | $loaded[ $key ] = $theme; 46 | } else { 47 | $loaded[ $key ] = null; 48 | } 49 | } 50 | } 51 | } 52 | 53 | return $loaded; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Data/Loader/UserRoleLoader.php: -------------------------------------------------------------------------------- 1 | roles; 34 | 35 | $loaded = []; 36 | if ( ! empty( $wp_roles ) && is_array( $wp_roles ) ) { 37 | foreach ( $keys as $key ) { 38 | if ( isset( $wp_roles[ $key ] ) ) { 39 | $role = $wp_roles[ $key ]; 40 | $role['slug'] = $key; 41 | $role['id'] = $key; 42 | $role['displayName'] = $role['name']; 43 | $role['name'] = $key; 44 | $loaded[ $key ] = $role; 45 | } else { 46 | $loaded[ $key ] = null; 47 | } 48 | } 49 | } 50 | 51 | return $loaded; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Data/README.md: -------------------------------------------------------------------------------- 1 | # Data 2 | 3 | Methods for reading and writing data should live here. The "DataSource" class serves as a factory for methods 4 | that handle the fetching/writing of data. -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Mutation/README.md: -------------------------------------------------------------------------------- 1 | # Mutation 2 | This directory contains registrations for mutations. 3 | 4 | In GraphQL the `mutation` keyword signifies that something in the graph will be changing as a result of the request. 5 | 6 | This directory contains registrations for mutations. 7 | 8 | Learn more about GraphQL mutations here: https://graphql.org/learn/queries/#mutations 9 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Registry/SchemaRegistry.php: -------------------------------------------------------------------------------- 1 | type_registry = \WPGraphQL::get_type_registry(); 27 | } 28 | 29 | /** 30 | * Returns the Schema to use for execution of the GraphQL Request 31 | * 32 | * @return WPSchema 33 | * @throws \Exception 34 | */ 35 | public function get_schema() { 36 | 37 | $this->type_registry->init(); 38 | 39 | $schema_config = new SchemaConfig(); 40 | $schema_config->query = $this->type_registry->get_type( 'RootQuery' ); 41 | $schema_config->mutation = $this->type_registry->get_type( 'RootMutation' ); 42 | $schema_config->typeLoader = function ( $type ) { 43 | return $this->type_registry->get_type( $type ); 44 | }; 45 | $schema_config->types = $this->type_registry->get_types(); 46 | 47 | /** 48 | * Create a new instance of the Schema 49 | */ 50 | $schema = new WPSchema( $schema_config ); 51 | 52 | /** 53 | * Filter the Schema 54 | * 55 | * @param WPSchema $schema The generated Schema 56 | * @param SchemaRegistry $this The Schema Registry Instance 57 | */ 58 | return apply_filters( 'graphql_schema', $schema, $this ); 59 | 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Server/ValidationRules/DisableIntrospection.php: -------------------------------------------------------------------------------- 1 | __( "What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are judged in that order. Default is the value of the 'avatar_rating' option", 'wp-graphql' ), 16 | 'values' => [ 17 | 'G' => [ 18 | 'description' => 'Indicates a G level avatar rating level.', 19 | 'value' => 'G', 20 | ], 21 | 'PG' => [ 22 | 'description' => 'Indicates a PG level avatar rating level.', 23 | 'value' => 'PG', 24 | ], 25 | 'R' => [ 26 | 'description' => 'Indicates an R level avatar rating level.', 27 | 'value' => 'R', 28 | ], 29 | 'X' => [ 30 | 'description' => 'Indicates an X level avatar rating level.', 31 | 'value' => 'X', 32 | ], 33 | ], 34 | ] 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/ContentTypeIdTypeEnum.php: -------------------------------------------------------------------------------- 1 | __( 'The Type of Identifier used to fetch a single Content Type node. To be used along with the "id" field. Default is "ID".', 'wp-graphql' ), 18 | 'values' => [ 19 | 'ID' => [ 20 | 'name' => 'ID', 21 | 'value' => 'id', 22 | 'description' => __( 'The globally unique ID', 'wp-graphql' ), 23 | ], 24 | 'NAME' => [ 25 | 'name' => 'NAME', 26 | 'value' => 'name', 27 | 'description' => __( 'The name of the content type.', 'wp-graphql' ), 28 | ], 29 | ], 30 | ] 31 | ); 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/MediaItemSizeEnum.php: -------------------------------------------------------------------------------- 1 | sprintf( __( 'MediaItem with the %1$s size', 'wp-graphql' ), $image_size ), 39 | 'value' => $image_size, 40 | ]; 41 | } 42 | } 43 | 44 | register_graphql_enum_type( 45 | 'MediaItemSizeEnum', 46 | [ 47 | 'description' => __( 'The size of the media item object.', 'wp-graphql' ), 48 | 'values' => $values, 49 | ] 50 | ); 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/MediaItemStatusEnum.php: -------------------------------------------------------------------------------- 1 | sprintf( __( 'Objects with the %1$s status', 'wp-graphql' ), $status ), 36 | 'value' => $status, 37 | ]; 38 | } 39 | } 40 | 41 | register_graphql_enum_type( 42 | 'MediaItemStatusEnum', 43 | [ 44 | 'description' => __( 'The status of the media item object.', 'wp-graphql' ), 45 | 'values' => $values, 46 | ] 47 | ); 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/MenuItemNodeIdTypeEnum.php: -------------------------------------------------------------------------------- 1 | __( 'The Type of Identifier used to fetch a single node. Default is "ID". To be used along with the "id" field.', 'wp-graphql' ), 19 | 'values' => [ 20 | 'ID' => [ 21 | 'name' => 'ID', 22 | 'value' => 'global_id', 23 | 'description' => __( 'Identify a resource by the (hashed) Global ID.', 'wp-graphql' ), 24 | ], 25 | 'DATABASE_ID' => [ 26 | 'name' => 'DATABASE_ID', 27 | 'value' => 'database_id', 28 | 'description' => __( 'Identify a resource by the Database ID.', 'wp-graphql' ), 29 | ], 30 | ], 31 | ]); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/MenuLocationEnum.php: -------------------------------------------------------------------------------- 1 | $location, 23 | 'description' => sprintf( __( 'Put the menu in the %s location', 'wp-graphql' ), $location ), 24 | ]; 25 | } 26 | } 27 | 28 | if ( empty( $values ) ) { 29 | $values['EMPTY'] = [ 30 | 'value' => 'Empty menu location', 31 | 'description' => __( 'Empty menu location', 'wp-graphql' ), 32 | ]; 33 | } 34 | 35 | register_graphql_enum_type( 36 | 'MenuLocationEnum', 37 | [ 38 | 'description' => __( 'Registered menu locations', 'wp-graphql' ), 39 | 'values' => $values, 40 | ] 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/MenuNodeIdTypeEnum.php: -------------------------------------------------------------------------------- 1 | __( 'The Type of Identifier used to fetch a single node. Default is "ID". To be used along with the "id" field.', 'wp-graphql' ), 19 | 'values' => [ 20 | 'ID' => [ 21 | 'name' => 'ID', 22 | 'value' => 'global_id', 23 | 'description' => __( 'Identify a menu node by the (hashed) Global ID.', 'wp-graphql' ), 24 | ], 25 | 'DATABASE_ID' => [ 26 | 'name' => 'DATABASE_ID', 27 | 'value' => 'database_id', 28 | 'description' => __( 'Identify a menu node by the Database ID.', 'wp-graphql' ), 29 | ], 30 | 'NAME' => [ 31 | 'name' => 'NAME', 32 | 'value' => 'name', 33 | 'description' => __( 'Identify a menu node by it\'s name', 'wp-graphql' ), 34 | ], 35 | ], 36 | ]); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/MimeTypeEnum.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'value' => 'image/jpeg', 18 | 'description' => __( 'An image in the JPEG format', 'wp-graphql' ), 19 | ], 20 | ]; 21 | 22 | $allowed_mime_types = get_allowed_mime_types(); 23 | 24 | if ( ! empty( $allowed_mime_types ) ) { 25 | $values = []; 26 | foreach ( $allowed_mime_types as $mime_type ) { 27 | $values[ WPEnumType::get_safe_name( $mime_type ) ] = [ 28 | 'value' => $mime_type, 29 | 'description' => sprintf( __( 'MimeType %s', 'wp-graphql' ), $mime_type ), 30 | ]; 31 | } 32 | } 33 | 34 | register_graphql_enum_type( 35 | 'MimeTypeEnum', 36 | [ 37 | 'description' => __( 'The MimeType of the object', 'wp-graphql' ), 38 | 'values' => $values, 39 | ] 40 | ); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/OrderEnum.php: -------------------------------------------------------------------------------- 1 | __( 'The cardinality of the connection order', 'wp-graphql' ), 17 | 'values' => [ 18 | 'ASC' => [ 19 | 'value' => 'ASC', 20 | 'description' => __( 'Sort the query result set in an ascending order', 'wp-graphql' ), 21 | ], 22 | 'DESC' => [ 23 | 'value' => 'DESC', 24 | 'description' => __( 'Sort the query result set in a descending order', 'wp-graphql' ), 25 | ], 26 | ], 27 | 'defaultValue' => 'DESC', 28 | ] 29 | ); 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/PostObjectFieldFormatEnum.php: -------------------------------------------------------------------------------- 1 | __( 'The format of post field data.', 'wp-graphql' ), 17 | 'values' => [ 18 | 'RAW' => [ 19 | 'name' => 'RAW', 20 | 'description' => __( 'Provide the field value directly from database', 'wp-graphql' ), 21 | 'value' => 'raw', 22 | ], 23 | 'RENDERED' => [ 24 | 'name' => 'RENDERED', 25 | 'description' => __( 'Apply the default WordPress rendering', 'wp-graphql' ), 26 | 'value' => 'rendered', 27 | ], 28 | ], 29 | ] 30 | ); 31 | } 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php: -------------------------------------------------------------------------------- 1 | __( 'The column to use when filtering by date', 'wp-graphql' ), 17 | 'values' => [ 18 | 'DATE' => [ 19 | 'value' => 'post_date', 20 | 'description' => __( 'The date the comment was created in local time.', 'wp-graphql' ), 21 | ], 22 | 'MODIFIED' => [ 23 | 'value' => 'post_modified', 24 | 'description' => __( 'The most recent modification date of the comment.', 'wp-graphql' ), 25 | ], 26 | ], 27 | ] 28 | ); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/PostStatusEnum.php: -------------------------------------------------------------------------------- 1 | 'PUBLISH', 17 | 'value' => 'publish', 18 | ]; 19 | 20 | $post_stati = get_post_stati(); 21 | 22 | if ( ! empty( $post_stati ) && is_array( $post_stati ) ) { 23 | /** 24 | * Reset the array 25 | */ 26 | $post_status_enum_values = []; 27 | /** 28 | * Loop through the post_stati 29 | */ 30 | foreach ( $post_stati as $status ) { 31 | $post_status_enum_values[ WPEnumType::get_safe_name( $status ) ] = [ 32 | 'description' => sprintf( __( 'Objects with the %1$s status', 'wp-graphql' ), $status ), 33 | 'value' => $status, 34 | ]; 35 | } 36 | } 37 | 38 | register_graphql_enum_type( 39 | 'PostStatusEnum', 40 | [ 41 | 'description' => __( 'The status of the object.', 'wp-graphql' ), 42 | 'values' => $post_status_enum_values, 43 | ] 44 | ); 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/RelationEnum.php: -------------------------------------------------------------------------------- 1 | __( 'The logical relation between each item in the array when there are more than one.', 'wp-graphql' ), 17 | 'values' => [ 18 | 'AND' => [ 19 | 'name' => 'AND', 20 | 'value' => 'AND', 21 | 'description' => __( 'The logical AND condition returns true if both operands are true, otherwise, it returns false.', 'wp-graphql' ), 22 | ], 23 | 'OR' => [ 24 | 'name' => 'OR', 25 | 'value' => 'OR', 26 | 'description' => __( 'The logical OR condition returns false if both operands are false, otherwise, it returns true.', 'wp-graphql' ), 27 | ], 28 | ], 29 | ] 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/TaxonomyEnum.php: -------------------------------------------------------------------------------- 1 | graphql_single_name ) ] ) ) { 28 | $values[ WPEnumType::get_safe_name( $taxonomy_object->graphql_single_name ) ] = [ 29 | 'value' => $allowed_taxonomy, 30 | 'description' => sprintf( __( 'Taxonomy enum %s', 'wp-graphql' ), $allowed_taxonomy ), 31 | ]; 32 | } 33 | } 34 | } 35 | 36 | register_graphql_enum_type( 37 | 'TaxonomyEnum', 38 | [ 39 | 'description' => __( 'Allowed taxonomies', 'wp-graphql' ), 40 | 'values' => $values, 41 | ] 42 | ); 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/TaxonomyIdTypeEnum.php: -------------------------------------------------------------------------------- 1 | __( 'The Type of Identifier used to fetch a single Taxonomy node. To be used along with the "id" field. Default is "ID".', 'wp-graphql' ), 18 | 'values' => [ 19 | 'ID' => [ 20 | 'name' => 'ID', 21 | 'value' => 'id', 22 | 'description' => __( 'The globally unique ID', 'wp-graphql' ), 23 | ], 24 | 'NAME' => [ 25 | 'name' => 'NAME', 26 | 'value' => 'name', 27 | 'description' => __( 'The name of the taxonomy', 'wp-graphql' ), 28 | ], 29 | ], 30 | ] 31 | ); 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php: -------------------------------------------------------------------------------- 1 | __( 'Options for ordering the connection by', 'wp-graphql' ), 16 | 'values' => [ 17 | 'NAME' => [ 18 | 'value' => 'name', 19 | 'description' => __( 'Order the connection by name.', 'wp-graphql' ), 20 | ], 21 | 'SLUG' => [ 22 | 'value' => 'slug', 23 | 'description' => __( 'Order the connection by slug.', 'wp-graphql' ), 24 | ], 25 | 'TERM_GROUP' => [ 26 | 'value' => 'term_group', 27 | 'description' => __( 'Order the connection by term group.', 'wp-graphql' ), 28 | ], 29 | 'TERM_ID' => [ 30 | 'value' => 'term_id', 31 | 'description' => __( 'Order the connection by term id.', 'wp-graphql' ), 32 | ], 33 | 'TERM_ORDER' => [ 34 | 'value' => 'term_order', 35 | 'description' => __( 'Order the connection by term order.', 'wp-graphql' ), 36 | ], 37 | 'DESCRIPTION' => [ 38 | 'value' => 'description', 39 | 'description' => __( 'Order the connection by description.', 'wp-graphql' ), 40 | ], 41 | 'COUNT' => [ 42 | 'value' => 'count', 43 | 'description' => __( 'Order the connection by item count.', 'wp-graphql' ), 44 | ], 45 | ], 46 | ] 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/UserNodeIdTypeEnum.php: -------------------------------------------------------------------------------- 1 | __( 'The Type of Identifier used to fetch a single User node. To be used along with the "id" field. Default is "ID".', 'wp-graphql' ), 16 | 'values' => self::get_values(), 17 | ] 18 | ); 19 | } 20 | 21 | /** 22 | * Returns the values for the Enum. 23 | * 24 | * @return array 25 | */ 26 | public static function get_values() { 27 | return [ 28 | 'ID' => [ 29 | 'name' => 'ID', 30 | 'value' => 'global_id', 31 | 'description' => __( 'The hashed Global ID', 'wp-graphql' ), 32 | ], 33 | 'DATABASE_ID' => [ 34 | 'name' => 'DATABASE_ID', 35 | 'value' => 'database_id', 36 | 'description' => __( 'The Database ID for the node', 'wp-graphql' ), 37 | ], 38 | 'URI' => [ 39 | 'name' => 'URI', 40 | 'value' => 'uri', 41 | 'description' => __( 'The URI for the node', 'wp-graphql' ), 42 | ], 43 | 'SLUG' => [ 44 | 'name' => 'SLUG', 45 | 'value' => 'slug', 46 | 'description' => __( 'The slug of the User', 'wp-graphql' ), 47 | ], 48 | 'EMAIL' => [ 49 | 'name' => 'EMAIL', 50 | 'value' => 'email', 51 | 'description' => __( 'The Email of the User', 'wp-graphql' ), 52 | ], 53 | 'USERNAME' => [ 54 | 'name' => 'USERNAME', 55 | 'value' => 'login', 56 | 'description' => __( 'The username the User uses to login with', 'wp-graphql' ), 57 | ], 58 | ]; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/UserRoleEnum.php: -------------------------------------------------------------------------------- 1 | roles; 17 | $editable_roles = apply_filters( 'editable_roles', $all_roles ); 18 | $roles = []; 19 | 20 | if ( ! empty( $editable_roles ) && is_array( $editable_roles ) ) { 21 | foreach ( $editable_roles as $key => $role ) { 22 | 23 | $formatted_role = WPEnumType::get_safe_name( isset( $role['name'] ) ? $role['name'] : $key ); 24 | 25 | $roles[ $formatted_role ] = [ 26 | 'description' => __( 'User role with specific capabilities', 'wp-graphql' ), 27 | 'value' => $key, 28 | ]; 29 | } 30 | } 31 | 32 | if ( ! empty( $roles ) && is_array( $roles ) ) { 33 | register_graphql_enum_type( 34 | 'UserRoleEnum', 35 | [ 36 | 'description' => __( 'Names of available user roles', 'wp-graphql' ), 37 | 'values' => $roles, 38 | ] 39 | ); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/UsersConnectionOrderbyEnum.php: -------------------------------------------------------------------------------- 1 | __( 'Field to order the connection by', 'wp-graphql' ), 18 | 'values' => [ 19 | 'DISPLAY_NAME' => [ 20 | 'value' => 'display_name', 21 | 'description' => __( 'Order by display name', 'wp-graphql' ), 22 | ], 23 | 'EMAIL' => [ 24 | 'value' => 'user_email', 25 | 'description' => __( 'Order by email address', 'wp-graphql' ), 26 | ], 27 | 'LOGIN' => [ 28 | 'value' => 'user_login', 29 | 'description' => __( 'Order by login', 'wp-graphql' ), 30 | ], 31 | 'LOGIN_IN' => [ 32 | 'value' => 'login__in', 33 | 'description' => __( 'Preserve the login order given in the LOGIN_IN array', 'wp-graphql' ), 34 | ], 35 | 'NICE_NAME' => [ 36 | 'value' => 'user_nicename', 37 | 'description' => __( 'Order by nice name', 'wp-graphql' ), 38 | ], 39 | 'NICE_NAME_IN' => [ 40 | 'value' => 'nicename__in', 41 | 'description' => __( 'Preserve the nice name order given in the NICE_NAME_IN array', 'wp-graphql' ), 42 | ], 43 | 'REGISTERED' => [ 44 | 'value' => 'user_registered', 45 | 'description' => __( 'Order by registration date', 'wp-graphql' ), 46 | ], 47 | 'URL' => [ 48 | 'value' => 'user_url', 49 | 'description' => __( 'Order by URL', 'wp-graphql' ), 50 | ], 51 | ], 52 | ] 53 | ); 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Enum/UsersConnectionSearchColumnEnum.php: -------------------------------------------------------------------------------- 1 | __( 'Column used for searching for users.', 'wp-graphql' ), 17 | 'values' => [ 18 | 'ID' => [ 19 | 'value' => 'ID', 20 | 'description' => __( 'The globally unique ID.', 'wp-graphql' ), 21 | ], 22 | 'LOGIN' => [ 23 | 'value' => 'login', 24 | 'description' => __( 'The username the User uses to login with.', 'wp-graphql' ), 25 | ], 26 | 'NICENAME' => [ 27 | 'value' => 'nicename', 28 | 'description' => __( 'A URL-friendly name for the user. The default is the user\'s username.', 'wp-graphql' ), 29 | ], 30 | 'EMAIL' => [ 31 | 'value' => 'email', 32 | 'description' => __( 'The user\'s email address.', 'wp-graphql' ), 33 | ], 34 | 'URL' => [ 35 | 'value' => 'url', 36 | 'description' => __( 'The URL of the user\s website.', 'wp-graphql' ), 37 | ], 38 | ], 39 | ] 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Input/DateInput.php: -------------------------------------------------------------------------------- 1 | __( 'Date values', 'wp-graphql' ), 16 | 'fields' => [ 17 | 'year' => [ 18 | 'type' => 'Int', 19 | 'description' => __( '4 digit year (e.g. 2017)', 'wp-graphql' ), 20 | ], 21 | 'month' => [ 22 | 'type' => 'Int', 23 | 'description' => __( 'Month number (from 1 to 12)', 'wp-graphql' ), 24 | ], 25 | 'day' => [ 26 | 'type' => 'Int', 27 | 'description' => __( 'Day of the month (from 1 to 31)', 'wp-graphql' ), 28 | ], 29 | ], 30 | ] 31 | ); 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Input/PostObjectsConnectionOrderbyInput.php: -------------------------------------------------------------------------------- 1 | __( 'Options for ordering the connection', 'wp-graphql' ), 17 | 'fields' => [ 18 | 'field' => [ 19 | 'type' => [ 20 | 'non_null' => 'PostObjectsConnectionOrderbyEnum', 21 | ], 22 | 'description' => __( 'The field to order the connection by', 'wp-graphql' ), 23 | ], 24 | 'order' => [ 25 | 'type' => [ 26 | 'non_null' => 'OrderEnum', 27 | ], 28 | 'description' => __( 'Possible directions in which to order a list of items', 'wp-graphql' ), 29 | ], 30 | ], 31 | ] 32 | ); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Input/UsersConnectionOrderbyInput.php: -------------------------------------------------------------------------------- 1 | __( 'Options for ordering the connection', 'wp-graphql' ), 18 | 'fields' => [ 19 | 'field' => [ 20 | 'description' => __( 'The field name used to sort the results.', 'wp-graphql' ), 21 | 'type' => [ 22 | 'non_null' => 'UsersConnectionOrderbyEnum', 23 | ], 24 | ], 25 | 'order' => [ 26 | 'description' => __( 'The cardinality of the order of the connection', 'wp-graphql' ), 27 | 'type' => 'OrderEnum', 28 | ], 29 | ], 30 | ] 31 | ); 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/ContentTemplate.php: -------------------------------------------------------------------------------- 1 | __( 'The template assigned to a node of content', 'wp-graphql' ), 17 | 'fields' => [ 18 | 'templateName' => [ 19 | 'type' => 'String', 20 | 'description' => __( 'The name of the template', 'wp-graphql' ), 21 | ], 22 | ], 23 | 'resolveType' => function ( $value ) { 24 | return isset( $value['__typename'] ) ? $value['__typename'] : 'DefaultTemplate'; 25 | }, 26 | ] 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/DatabaseIdentifier.php: -------------------------------------------------------------------------------- 1 | __( 'Object that can be identified with a Database ID', 'wp-graphql' ), 21 | 'fields' => [ 22 | 'databaseId' => [ 23 | 'type' => [ 'non_null' => 'Int' ], 24 | 'description' => __( 'The unique identifier stored in the database', 'wp-graphql' ), 25 | ], 26 | ], 27 | ]); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/HierarchicalContentNode.php: -------------------------------------------------------------------------------- 1 | __( 'Content node with hierarchical (parent/child) relationships', 'wp-graphql' ), 25 | 'fields' => [ 26 | 'parentId' => [ 27 | 'type' => 'ID', 28 | 'description' => __( 'The globally unique identifier of the parent node.', 'wp-graphql' ), 29 | ], 30 | 'parentDatabaseId' => [ 31 | 'type' => 'Int', 32 | 'description' => __( 'Database id of the parent node', 'wp-graphql' ), 33 | ], 34 | ], 35 | ] 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/HierarchicalTermNode.php: -------------------------------------------------------------------------------- 1 | __( 'Term node with hierarchical (parent/child) relationships', 'wp-graphql' ), 24 | 'fields' => [ 25 | 'parentId' => [ 26 | 'type' => 'ID', 27 | 'description' => __( 'The globally unique identifier of the parent node.', 'wp-graphql' ), 28 | ], 29 | 'parentDatabaseId' => [ 30 | 'type' => 'Int', 31 | 'description' => __( 'Database id of the parent node', 'wp-graphql' ), 32 | ], 33 | ], 34 | ]); 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/Node.php: -------------------------------------------------------------------------------- 1 | __( 'An object with an ID', 'wp-graphql' ), 18 | 'fields' => [ 19 | 'id' => [ 20 | 'type' => [ 'non_null' => 'ID' ], 21 | 'description' => __( 'The globally unique ID for the object', 'wp-graphql' ), 22 | ], 23 | ], 24 | 'resolveType' => function ( $node ) { 25 | return DataSource::resolve_node_type( $node ); 26 | }, 27 | ] 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/NodeWithAuthor.php: -------------------------------------------------------------------------------- 1 | __( 'A node that can have an author assigned to it', 'wp-graphql' ), 23 | 'fields' => [ 24 | 'authorId' => [ 25 | 'type' => 'ID', 26 | 'description' => __( 'The globally unique identifier of the author of the node', 'wp-graphql' ), 27 | ], 28 | 'authorDatabaseId' => [ 29 | 'type' => 'Int', 30 | 'description' => __( 'The database identifier of the author of the node', 'wp-graphql' ), 31 | ], 32 | ], 33 | ] 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/NodeWithComments.php: -------------------------------------------------------------------------------- 1 | __( 'A node that can have comments associated with it', 'wp-graphql' ), 19 | 'fields' => [ 20 | 'commentCount' => [ 21 | 'type' => 'Int', 22 | 'description' => __( 'The number of comments. Even though WPGraphQL denotes this field as an integer, in WordPress this field should be saved as a numeric string for compatibility.', 'wp-graphql' ), 23 | ], 24 | 'commentStatus' => [ 25 | 'type' => 'String', 26 | 'description' => __( 'Whether the comments are open or closed for this particular post.', 'wp-graphql' ), 27 | ], 28 | ], 29 | ] 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/NodeWithContentEditor.php: -------------------------------------------------------------------------------- 1 | __( 'A node that supports the content editor', 'wp-graphql' ), 19 | 'fields' => [ 20 | 'content' => [ 21 | 'type' => 'String', 22 | 'description' => __( 'The content of the post.', 'wp-graphql' ), 23 | 'args' => [ 24 | 'format' => [ 25 | 'type' => 'PostObjectFieldFormatEnum', 26 | 'description' => __( 'Format of the field output', 'wp-graphql' ), 27 | ], 28 | ], 29 | 'resolve' => function ( $source, $args ) { 30 | if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { 31 | // @codingStandardsIgnoreLine. 32 | return $source->contentRaw; 33 | } 34 | 35 | // @codingStandardsIgnoreLine. 36 | return $source->contentRendered; 37 | }, 38 | ], 39 | ], 40 | ] 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/NodeWithExcerpt.php: -------------------------------------------------------------------------------- 1 | __( 'A node that can have an excerpt', 'wp-graphql' ), 20 | 'fields' => [ 21 | 'excerpt' => [ 22 | 'type' => 'String', 23 | 'description' => __( 'The excerpt of the post.', 'wp-graphql' ), 24 | 'args' => [ 25 | 'format' => [ 26 | 'type' => 'PostObjectFieldFormatEnum', 27 | 'description' => __( 'Format of the field output', 'wp-graphql' ), 28 | ], 29 | ], 30 | 'resolve' => function ( $source, $args ) { 31 | if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { 32 | // @codingStandardsIgnoreLine. 33 | return $source->excerptRaw; 34 | } 35 | 36 | // @codingStandardsIgnoreLine. 37 | return $source->excerptRendered; 38 | }, 39 | ], 40 | ], 41 | ] 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/NodeWithPageAttributes.php: -------------------------------------------------------------------------------- 1 | __( 'A node that can have page attributes', 'wp-graphql' ), 20 | 'fields' => [ 21 | 'menuOrder' => [ 22 | 'type' => 'Int', 23 | 'description' => __( 'A field used for ordering posts. This is typically used with nav menu items or for special ordering of hierarchical content types.', 'wp-graphql' ), 24 | ], 25 | ], 26 | ] 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/NodeWithRevisions.php: -------------------------------------------------------------------------------- 1 | __( 'A node that can have revisions', 'wp-graphql' ), 20 | 'fields' => [ 21 | 'isRevision' => [ 22 | 'type' => 'Boolean', 23 | 'description' => __( 'True if the node is a revision of another node', 'wp-graphql' ), 24 | ], 25 | ], 26 | ] 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/NodeWithTemplate.php: -------------------------------------------------------------------------------- 1 | __( 'A node that can have a template associated with it', 'wp-graphql' ), 18 | 'fields' => [ 19 | 'template' => [ 20 | 'description' => __( 'The template assigned to the node', 'wp-graphql' ), 21 | 'type' => 'ContentTemplate', 22 | ], 23 | ], 24 | ]); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/NodeWithTitle.php: -------------------------------------------------------------------------------- 1 | __( 'A node that NodeWith a title', 'wp-graphql' ), 25 | 'fields' => [ 26 | 'title' => [ 27 | 'type' => 'String', 28 | 'description' => __( 'The title of the post. This is currently just the raw title. An amendment to support rendered title needs to be made.', 'wp-graphql' ), 29 | 'args' => [ 30 | 'format' => [ 31 | 'type' => 'PostObjectFieldFormatEnum', 32 | 'description' => __( 'Format of the field output', 'wp-graphql' ), 33 | ], 34 | ], 35 | 'resolve' => function ( $source, $args ) { 36 | if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { 37 | // @codingStandardsIgnoreLine. 38 | return $source->titleRaw; 39 | } 40 | 41 | // @codingStandardsIgnoreLine. 42 | return $source->titleRendered; 43 | }, 44 | ], 45 | ], 46 | ] 47 | ); 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/InterfaceType/NodeWithTrackbacks.php: -------------------------------------------------------------------------------- 1 | __( 'A node that can have trackbacks and pingbacks', 'wp-graphql' ), 20 | 'fields' => [ 21 | 'toPing' => [ 22 | 'type' => [ 'list_of' => 'String' ], 23 | 'description' => __( 'URLs queued to be pinged.', 'wp-graphql' ), 24 | ], 25 | 'pinged' => [ 26 | 'type' => [ 'list_of' => 'String' ], 27 | 'description' => __( 'URLs that have been pinged.', 'wp-graphql' ), 28 | ], 29 | 'pingStatus' => [ 30 | 'type' => 'String', 31 | 'description' => __( 'Whether the pings are open or closed for this particular post.', 'wp-graphql' ), 32 | ], 33 | ], 34 | ] 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/ObjectType/CommentAuthor.php: -------------------------------------------------------------------------------- 1 | __( 'A Comment Author object', 'wp-graphql' ), 17 | 'interfaces' => [ 'Node', 'Commenter' ], 18 | 'eagerlyLoadType' => true, 19 | 'fields' => [ 20 | 'id' => [ 21 | 'description' => __( 'The globally unique identifier for the comment author object', 'wp-graphql' ), 22 | ], 23 | 'name' => [ 24 | 'type' => 'String', 25 | 'description' => __( 'The name for the comment author.', 'wp-graphql' ), 26 | ], 27 | 'email' => [ 28 | 'type' => 'String', 29 | 'description' => __( 'The email for the comment author', 'wp-graphql' ), 30 | ], 31 | 'url' => [ 32 | 'type' => 'String', 33 | 'description' => __( 'The url the comment author.', 'wp-graphql' ), 34 | ], 35 | 'isRestricted' => [ 36 | 'type' => 'Boolean', 37 | 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), 38 | ], 39 | ], 40 | ] 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/ObjectType/EnqueuedScript.php: -------------------------------------------------------------------------------- 1 | __( 'Script enqueued by the CMS', 'wp-graphql' ), 22 | 'interfaces' => [ 'Node', 'EnqueuedAsset' ], 23 | 'fields' => [ 24 | 'id' => [ 25 | 'type' => [ 26 | 'non_null' => 'ID', 27 | ], 28 | 'resolve' => function ( $asset ) { 29 | return isset( $asset->handle ) ? Relay::toGlobalId( 'enqueued_script', $asset->handle ) : null; 30 | }, 31 | ], 32 | 'src' => [ 33 | 'resolve' => function ( \_WP_Dependency $script ) { 34 | return isset( $script->src ) && is_string( $script->src ) ? $script->src : null; 35 | }, 36 | ], 37 | ], 38 | ] ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/ObjectType/EnqueuedStylesheet.php: -------------------------------------------------------------------------------- 1 | __( 'Stylesheet enqueued by the CMS', 'wp-graphql' ), 22 | 'interfaces' => [ 'Node', 'EnqueuedAsset' ], 23 | 'fields' => [ 24 | 'id' => [ 25 | 'type' => [ 26 | 'non_null' => 'ID', 27 | ], 28 | 'resolve' => function ( $asset ) { 29 | return isset( $asset->handle ) ? Relay::toGlobalId( 'enqueued_stylesheet', $asset->handle ) : null; 30 | }, 31 | ], 32 | 'src' => [ 33 | 'resolve' => function ( \_WP_Dependency $stylesheet ) { 34 | return isset( $stylesheet->src ) && is_string( $stylesheet->src ) ? $stylesheet->src : null; 35 | }, 36 | ], 37 | ], 38 | ] ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/ObjectType/PageInfo.php: -------------------------------------------------------------------------------- 1 | __( 'Information about pagination in a connection.', 'wp-graphql' ), 25 | 'fields' => [ 26 | 'hasNextPage' => [ 27 | 'type' => [ 28 | 'non_null' => 'Boolean', 29 | ], 30 | 'description' => __( 'When paginating forwards, are there more items?', 'wp-graphql' ), 31 | ], 32 | 'hasPreviousPage' => [ 33 | 'type' => [ 34 | 'non_null' => 'Boolean', 35 | ], 36 | 'description' => __( 'When paginating backwards, are there more items?', 'wp-graphql' ), 37 | ], 38 | 'startCursor' => [ 39 | 'type' => 'String', 40 | 'description' => __( 'When paginating backwards, the cursor to continue.', 'wp-graphql' ), 41 | ], 42 | 'endCursor' => [ 43 | 'type' => 'String', 44 | 'description' => __( 'When paginating forwards, the cursor to continue.', 'wp-graphql' ), 45 | ], 46 | ], 47 | 48 | ] 49 | ); 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/ObjectType/RootMutation.php: -------------------------------------------------------------------------------- 1 | __( 'The root mutation', 'wp-graphql' ), 18 | 'fields' => [ 19 | 'increaseCount' => [ 20 | 'type' => 'Int', 21 | 'description' => __( 'Increase the count.', 'wp-graphql' ), 22 | 'args' => [ 23 | 'count' => [ 24 | 'type' => 'Int', 25 | 'description' => __( 'The count to increase', 'wp-graphql' ), 26 | ], 27 | ], 28 | 'resolve' => function ( $root, $args ) { 29 | return isset( $args['count'] ) ? absint( $args['count'] ) + 1 : null; 30 | }, 31 | ], 32 | ], 33 | ] 34 | ); 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/ObjectType/TermObject.php: -------------------------------------------------------------------------------- 1 | public ) { 27 | $interfaces[] = 'UniformResourceIdentifiable'; 28 | } 29 | 30 | if ( $taxonomy_object->hierarchical ) { 31 | $interfaces[] = 'HierarchicalTermNode'; 32 | } 33 | 34 | if ( true === $taxonomy_object->show_in_nav_menus ) { 35 | $interfaces[] = 'MenuItemLinkable'; 36 | } 37 | 38 | $single_name = $taxonomy_object->graphql_single_name; 39 | register_graphql_object_type( 40 | $single_name, 41 | [ 42 | 'description' => sprintf( __( 'The %s type', 'wp-graphql' ), $single_name ), 43 | 'interfaces' => $interfaces, 44 | 'fields' => [ 45 | $single_name . 'Id' => [ 46 | 'type' => 'Int', 47 | 'deprecationReason' => __( 'Deprecated in favor of databaseId', 'wp-graphql' ), 48 | 'description' => __( 'The id field matches the WP_Post->ID field.', 'wp-graphql' ), 49 | 'resolve' => function ( Term $term, $args, $context, $info ) { 50 | return absint( $term->term_id ); 51 | }, 52 | ], 53 | 'uri' => [ 54 | 'resolve' => function ( $term, $args, $context, $info ) { 55 | return ! empty( $term->link ) ? str_ireplace( home_url(), '', $term->link ) : ''; 56 | }, 57 | ], 58 | ], 59 | ] 60 | ); 61 | 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/ObjectType/UserRole.php: -------------------------------------------------------------------------------- 1 | __( 'A user role object', 'wp-graphql' ), 17 | 'interfaces' => [ 'Node' ], 18 | 'fields' => [ 19 | 'id' => [ 20 | 'description' => __( 'The globally unique identifier for the user role object.', 'wp-graphql' ), 21 | ], 22 | 'name' => [ 23 | 'type' => 'String', 24 | 'description' => __( 'The registered name of the role', 'wp-graphql' ), 25 | ], 26 | 'capabilities' => [ 27 | 'type' => [ 28 | 'list_of' => 'String', 29 | ], 30 | 'description' => __( 'The capabilities that belong to this role', 'wp-graphql' ), 31 | ], 32 | 'displayName' => [ 33 | 'type' => 'String', 34 | 'description' => __( 'The display name of the role', 'wp-graphql' ), 35 | ], 36 | 'isRestricted' => [ 37 | 'type' => 'Boolean', 38 | 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), 39 | ], 40 | ], 41 | ] 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/README.md: -------------------------------------------------------------------------------- 1 | # Type 2 | 3 | This directory contains type definitions. Each type is registered into the TypeRegistry for 4 | use throughout the Schema. 5 | 6 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Union/PostObjectUnion.php: -------------------------------------------------------------------------------- 1 | 'PostObjectUnion', 20 | 'typeNames' => self::get_possible_types(), 21 | 'description' => __( 'Union between the post, page and media item types', 'wp-graphql' ), 22 | 'resolveType' => function ( $value ) use ( $type_registry ) { 23 | 24 | $type = null; 25 | if ( isset( $value->post_type ) ) { 26 | $post_type_object = get_post_type_object( $value->post_type ); 27 | if ( isset( $post_type_object->graphql_single_name ) ) { 28 | $type = $type_registry->get_type( $post_type_object->graphql_single_name ); 29 | } 30 | } 31 | 32 | return ! empty( $type ) ? $type : null; 33 | }, 34 | ] 35 | ); 36 | } 37 | 38 | /** 39 | * Returns a list of possible types for the union 40 | * 41 | * @return array 42 | */ 43 | public static function get_possible_types() { 44 | $possible_types = []; 45 | $allowed_post_types = \WPGraphQL::get_allowed_post_types(); 46 | 47 | if ( ! empty( $allowed_post_types ) && is_array( $allowed_post_types ) ) { 48 | foreach ( $allowed_post_types as $allowed_post_type ) { 49 | if ( empty( $possible_types[ $allowed_post_type ] ) ) { 50 | $post_type_object = get_post_type_object( $allowed_post_type ); 51 | if ( isset( $post_type_object->graphql_single_name ) ) { 52 | $possible_types[ $allowed_post_type ] = $post_type_object->graphql_single_name; 53 | } 54 | } 55 | } 56 | } 57 | 58 | return $possible_types; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/Union/TermObjectUnion.php: -------------------------------------------------------------------------------- 1 | 'union', 20 | 'typeNames' => self::get_possible_types(), 21 | 'description' => __( 'Union between the Category, Tag and PostFormatPost types', 'wp-graphql' ), 22 | 'resolveType' => function ( $value ) use ( $type_registry ) { 23 | 24 | $type = null; 25 | if ( isset( $value->taxonomyName ) ) { 26 | $tax_object = get_taxonomy( $value->taxonomyName ); 27 | if ( isset( $tax_object->graphql_single_name ) ) { 28 | $type = $type_registry->get_type( $tax_object->graphql_single_name ); 29 | } 30 | } 31 | 32 | return ! empty( $type ) ? $type : null; 33 | 34 | }, 35 | ] 36 | ); 37 | } 38 | 39 | /** 40 | * Returns a list of possible types for the union 41 | * 42 | * @return array 43 | */ 44 | public static function get_possible_types() { 45 | $possible_types = []; 46 | 47 | $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies(); 48 | if ( ! empty( $allowed_taxonomies ) && is_array( $allowed_taxonomies ) ) { 49 | foreach ( $allowed_taxonomies as $allowed_taxonomy ) { 50 | if ( empty( $possible_types[ $allowed_taxonomy ] ) ) { 51 | $tax_object = get_taxonomy( $allowed_taxonomy ); 52 | if ( isset( $tax_object->graphql_single_name ) ) { 53 | $possible_types[ $allowed_taxonomy ] = $tax_object->graphql_single_name; 54 | } 55 | } 56 | } 57 | } 58 | return $possible_types; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/src/Type/WPScalar.php: -------------------------------------------------------------------------------- 1 | config = $config; 41 | 42 | /** 43 | * Set the $filterable_config as the $config that was passed to the WPSchema when instantiated 44 | * 45 | * @param SchemaConfig $config The config for the Schema. 46 | * 47 | * @since 0.0.9 48 | */ 49 | $this->filterable_config = apply_filters( 'graphql_schema_config', $config ); 50 | parent::__construct( $this->filterable_config ); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /vendor/wp-graphql/wp-graphql/wp-graphql.php: -------------------------------------------------------------------------------- 1 |