Skip to content

Commit

Permalink
refactor(graphql): remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
pmelab committed Dec 21, 2022
1 parent cda8e95 commit 72a409c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ DEPRECATED, use @isTemplate
"""
directive @template on FIELD_DEFINITION

################################################################################
# Directives for automatic resolvers.
################################################################################

directive @resolveEntityReference(
field: String!
single: Boolean!
) on FIELD_DEFINITION

directive @resolveEntityReferenceRevisions(
field: String!
single: Boolean!
) on FIELD_DEFINITION

# Directive for the "EntityFeed" plugin.
directive @entity(type: String!, bundle: String, access: Boolean) on OBJECT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,49 +186,6 @@ public function getFeeds(DocumentNode $ast): array {
return $this->feeds;
}

/**
* @see SilverbackGatsbySchemaExtension::$resolvers
*/
protected function getResolveDirectives(DocumentNode $ast): array {
if (isset($this->resolvers)) {
return $this->resolvers;
}
$this->resolvers = [];
foreach ($ast->definitions->getIterator() as $definition) {
if (!($definition instanceof ObjectTypeDefinitionNode)) {
continue;
}
foreach ($definition->fields as $field) {
foreach ($field->directives as $fieldDirective) {
$list = [];
if (in_array($fieldDirective->name->value, $list, TRUE)) {
$graphQlPath = $definition->name->value . '.' . $field->name->value;
$name = $fieldDirective->name->value;
$this->resolvers[$graphQlPath] = [
'name' => $name,
'arguments' => [],
];
foreach ($fieldDirective->arguments->getIterator() as $arg) {
/** @var \GraphQL\Language\AST\ArgumentNode $arg */
if ($arg->value instanceof ListValueNode) {
$this->resolvers[$graphQlPath]['arguments'][$arg->name->value] = [];
foreach ($arg->value->values->getIterator() as $value) {
if ($value instanceof StringValueNode) {
$this->resolvers[$graphQlPath]['arguments'][$arg->name->value][] = $value->value;
}
}
}
else {
$this->resolvers[$graphQlPath]['arguments'][$arg->name->value] = $arg->value->value;
}
}
}
}
}
}
return $this->resolvers;
}

/**
* Build the automatic schema definition for a given Feed.
*/
Expand Down

0 comments on commit 72a409c

Please sign in to comment.