Skip to content

Commit 311525d

Browse files
committed
Comment problematic code parts
1 parent c605d81 commit 311525d

File tree

2 files changed

+46
-38
lines changed

2 files changed

+46
-38
lines changed

features/graphql/mutation.feature

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -106,43 +106,47 @@ Feature: GraphQL mutation support
106106
And the JSON node "data.createDummy.arrayData[1]" should be equal to baz
107107
And the JSON node "data.createDummy.clientMutationId" should be equal to "myId"
108108

109-
Scenario: Create an item with an embedded field
110-
When I send the following GraphQL request:
111-
"""
112-
mutation {
113-
createRelatedDummy(input: {_id: 2, symfony: "symfony", embeddedDummy: {dummyName: "Embedded"}, clientMutationId: "myId"}) {
114-
id
115-
clientMutationId
116-
}
117-
}
118-
"""
119-
Then the response status code should be 200
120-
And the response should be in JSON
121-
And the header "Content-Type" should be equal to "application/json"
122-
And the JSON node "data.createRelatedDummy.id" should be equal to "/related_dummies/2"
123-
And the JSON node "data.createRelatedDummy.clientMutationId" should be equal to "myId"
109+
# @TODO StringIterableUnionInput is not used for now because it breaks graphql-php and GraphiQL.
110+
# Waiting for https://github.com/facebook/graphql/pull/395 to be merged.
111+
# Scenario: Create an item with an embedded field
112+
# When I send the following GraphQL request:
113+
# """
114+
# mutation {
115+
# createRelatedDummy(input: {_id: 2, symfony: "symfony", embeddedDummy: {dummyName: "Embedded"}, clientMutationId: "myId"}) {
116+
# id
117+
# clientMutationId
118+
# }
119+
# }
120+
# """
121+
# Then the response status code should be 200
122+
# And the response should be in JSON
123+
# And the header "Content-Type" should be equal to "application/json"
124+
# And the JSON node "data.createRelatedDummy.id" should be equal to "/related_dummies/2"
125+
# And the JSON node "data.createRelatedDummy.clientMutationId" should be equal to "myId"
124126

125-
Scenario: Create an item and update a nested resource through a mutation
126-
When I send the following GraphQL request:
127-
"""
128-
mutation {
129-
createRelationEmbedder(input: {paris: "paris", krondstadt: "Krondstadt", anotherRelated: {id: 2, symfony: "laravel"}, clientMutationId: "myId"}) {
130-
id
131-
anotherRelated {
132-
id
133-
symfony
134-
}
135-
clientMutationId
136-
}
137-
}
138-
"""
139-
Then the response status code should be 200
140-
And the response should be in JSON
141-
And the header "Content-Type" should be equal to "application/json"
142-
And the JSON node "data.createRelationEmbedder.id" should be equal to "/relation_embedders/1"
143-
And the JSON node "data.createRelationEmbedder.anotherRelated.id" should be equal to "/related_dummies/2"
144-
And the JSON node "data.createRelationEmbedder.anotherRelated.symfony" should be equal to "laravel"
145-
And the JSON node "data.createRelationEmbedder.clientMutationId" should be equal to "myId"
127+
# @TODO StringIterableUnionInput is not used for now because it breaks graphql-php and GraphiQL.
128+
# Waiting for https://github.com/facebook/graphql/pull/395 to be merged.
129+
# Scenario: Create an item and update a nested resource through a mutation
130+
# When I send the following GraphQL request:
131+
# """
132+
# mutation {
133+
# createRelationEmbedder(input: {paris: "paris", krondstadt: "Krondstadt", anotherRelated: {id: 2, symfony: "laravel"}, clientMutationId: "myId"}) {
134+
# id
135+
# anotherRelated {
136+
# id
137+
# symfony
138+
# }
139+
# clientMutationId
140+
# }
141+
# }
142+
# """
143+
# Then the response status code should be 200
144+
# And the response should be in JSON
145+
# And the header "Content-Type" should be equal to "application/json"
146+
# And the JSON node "data.createRelationEmbedder.id" should be equal to "/relation_embedders/1"
147+
# And the JSON node "data.createRelationEmbedder.anotherRelated.id" should be equal to "/related_dummies/2"
148+
# And the JSON node "data.createRelationEmbedder.anotherRelated.symfony" should be equal to "laravel"
149+
# And the JSON node "data.createRelationEmbedder.clientMutationId" should be equal to "myId"
146150

147151
Scenario: Delete an item through a mutation
148152
When I send the following GraphQL request:

src/GraphQl/Type/SchemaBuilder.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,10 @@ private function convertType(Type $type, bool $input = false, string $mutationNa
347347
break;
348348
case Type::BUILTIN_TYPE_OBJECT:
349349
if ($input && $depth > 0) {
350-
if (!isset($this->graphqlTypes['#stringIterableUnionInput'])) {
350+
/* @TODO Don't use StringIterableUnionInput for now because it breaks graphql-php and GraphiQL.
351+
* Waiting for https://github.com/facebook/graphql/pull/395 to be merged.
352+
*/
353+
/*if (!isset($this->graphqlTypes['#stringIterableUnionInput'])) {
351354
$this->graphqlTypes['#stringIterableUnionInput'] = new InputUnionType([
352355
'name' => 'StringIterableUnionInput',
353356
'description' => 'Resource\'s IRI or data (embedded entities or when updating a related existing resource)',
@@ -357,7 +360,8 @@ private function convertType(Type $type, bool $input = false, string $mutationNa
357360
],
358361
]);
359362
}
360-
$graphqlType = $this->graphqlTypes['#stringIterableUnionInput'];
363+
$graphqlType = $this->graphqlTypes['#stringIterableUnionInput'];*/
364+
$graphqlType = GraphQLType::string();
361365
break;
362366
}
363367
if (is_a($type->getClassName(), \DateTimeInterface::class, true)) {

0 commit comments

Comments
 (0)