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 |