Skip to content

Commit a3feed7

Browse files
authored
Merge pull request #813 from murtukov/feature/interfaces-implementing-interfaces
Allow interfaces implement interfaces
2 parents 070b804 + db8ff32 commit a3feed7

File tree

5 files changed

+35
-30
lines changed

5 files changed

+35
-30
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"symfony/framework-bundle": "^4.4 || ^5.0",
3939
"symfony/options-resolver": "^4.4 || ^5.0",
4040
"symfony/property-access": "^4.4 || ^5.0",
41-
"webonyx/graphql-php": "^14.0.1"
41+
"webonyx/graphql-php": ">=14.5"
4242
},
4343
"suggest": {
4444
"nelmio/cors-bundle": "For more flexibility when using CORS prefight",

src/Config/InterfaceTypeDefinition.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ public function getDefinition(): ArrayNodeDefinition
1313
/** @var ArrayNodeDefinition $node */
1414
$node = self::createNode('_interface_config');
1515

16+
/** @phpstan-ignore-next-line */
1617
$node
1718
->children()
1819
->append($this->nameSection())
1920
->append($this->outputFieldsSection())
2021
->append($this->resolveTypeSection())
2122
->append($this->descriptionSection())
23+
->arrayNode('interfaces')
24+
->prototype('scalar')->info('One of internal or custom interface types.')->end()
25+
->end()
2226
->end();
2327

2428
return $node;

tests/Functional/App/config/global/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ overblog_graphql:
1515
schema:
1616
query: Query
1717
mutation: ~
18+
types: [User, Photo, Post]
1819
mappings:
1920
types:
2021
-

tests/Functional/Command/fixtures/schema.descriptions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@
782782
},
783783
{
784784
"name": "INTERFACE",
785-
"description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.",
785+
"description": "Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.",
786786
"isDeprecated": false,
787787
"deprecationReason": null
788788
},

tests/Functional/Relay/Node/GlobalTest.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@ class GlobalTest extends TestCase
1616
protected function setUp(): void
1717
{
1818
parent::setUp();
19-
2019
static::bootKernel(['test_case' => 'global']);
2120
}
2221

2322
public function testGlobalIdFields(): void
2423
{
2524
$query = <<<'EOF'
26-
{
27-
allObjects {
28-
id
29-
}
30-
}
31-
EOF;
25+
{
26+
allObjects {
27+
id
28+
}
29+
}
30+
EOF;
3231

3332
$expectedData = [
3433
'allObjects' => [
@@ -59,28 +58,29 @@ public function testGlobalIdFields(): void
5958
public function testReFetchesTheIds(): void
6059
{
6160
$query = <<<'EOF'
62-
{
63-
user: node(id: "VXNlcjox") {
64-
id
65-
... on User {
66-
name
61+
{
62+
user: node(id: "VXNlcjox") {
63+
id
64+
... on User {
65+
name
66+
}
67+
},
68+
photo: node(id: "UGhvdG86MQ==") {
69+
id
70+
... on Photo {
71+
width
72+
}
73+
},
74+
post: node(id: "UG9zdDox") {
75+
id
76+
... on Post {
77+
text
78+
status
79+
}
80+
}
6781
}
68-
},
69-
photo: node(id: "UGhvdG86MQ==") {
70-
id
71-
... on Photo {
72-
width
73-
}
74-
},
75-
post: node(id: "UG9zdDox") {
76-
id
77-
... on Post {
78-
text
79-
status
80-
}
81-
}
82-
}
83-
EOF;
82+
EOF;
83+
8484
$expectedData = [
8585
'user' => [
8686
'id' => 'VXNlcjox',

0 commit comments

Comments
 (0)