Skip to content

Allow interfaces implement interfaces #813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"symfony/framework-bundle": "^4.4 || ^5.0",
"symfony/options-resolver": "^4.4 || ^5.0",
"symfony/property-access": "^4.4 || ^5.0",
"webonyx/graphql-php": "^14.0.1"
"webonyx/graphql-php": ">=14.5"
},
"suggest": {
"nelmio/cors-bundle": "For more flexibility when using CORS prefight",
Expand Down
4 changes: 4 additions & 0 deletions src/Config/InterfaceTypeDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ public function getDefinition(): ArrayNodeDefinition
/** @var ArrayNodeDefinition $node */
$node = self::createNode('_interface_config');

/** @phpstan-ignore-next-line */
$node
->children()
->append($this->nameSection())
->append($this->outputFieldsSection())
->append($this->resolveTypeSection())
->append($this->descriptionSection())
->arrayNode('interfaces')
->prototype('scalar')->info('One of internal or custom interface types.')->end()
->end()
->end();

return $node;
Expand Down
1 change: 1 addition & 0 deletions tests/Functional/App/config/global/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ overblog_graphql:
schema:
query: Query
mutation: ~
types: [User, Photo, Post]
mappings:
types:
-
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Command/fixtures/schema.descriptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@
},
{
"name": "INTERFACE",
"description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.",
"description": "Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.",
"isDeprecated": false,
"deprecationReason": null
},
Expand Down
56 changes: 28 additions & 28 deletions tests/Functional/Relay/Node/GlobalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ class GlobalTest extends TestCase
protected function setUp(): void
{
parent::setUp();

static::bootKernel(['test_case' => 'global']);
}

public function testGlobalIdFields(): void
{
$query = <<<'EOF'
{
allObjects {
id
}
}
EOF;
{
allObjects {
id
}
}
EOF;

$expectedData = [
'allObjects' => [
Expand Down Expand Up @@ -59,28 +58,29 @@ public function testGlobalIdFields(): void
public function testReFetchesTheIds(): void
{
$query = <<<'EOF'
{
user: node(id: "VXNlcjox") {
id
... on User {
name
{
user: node(id: "VXNlcjox") {
id
... on User {
name
}
},
photo: node(id: "UGhvdG86MQ==") {
id
... on Photo {
width
}
},
post: node(id: "UG9zdDox") {
id
... on Post {
text
status
}
}
}
},
photo: node(id: "UGhvdG86MQ==") {
id
... on Photo {
width
}
},
post: node(id: "UG9zdDox") {
id
... on Post {
text
status
}
}
}
EOF;
EOF;

$expectedData = [
'user' => [
'id' => 'VXNlcjox',
Expand Down