Skip to content

Commit

Permalink
Merge 646ddbd into 126e65d
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerbaptiste committed Dec 21, 2020
2 parents 126e65d + 646ddbd commit 32859ac
Show file tree
Hide file tree
Showing 18 changed files with 421 additions and 209 deletions.
5 changes: 5 additions & 0 deletions behat.yml.dist
Expand Up @@ -11,6 +11,7 @@ default:
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
filters:
Expand Down Expand Up @@ -45,6 +46,7 @@ postgres:
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
filters:
Expand All @@ -64,6 +66,7 @@ mongodb:
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
filters:
Expand Down Expand Up @@ -98,6 +101,7 @@ default-coverage:
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\CoverageContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'

Expand All @@ -117,6 +121,7 @@ mongodb-coverage:
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\CoverageContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -21,7 +21,7 @@
"symfony/http-foundation": "^4.4 || ^5.1",
"symfony/http-kernel": "^4.4 || ^5.1",
"symfony/property-access": "^3.4.19 || ^4.4 || ^5.1",
"symfony/property-info": "^3.4 || ^4.4 || ^5.1",
"symfony/property-info": "^3.4 || ^4.4 || ^5.2.1",
"symfony/serializer": "^4.4 || ^5.1",
"symfony/web-link": "^4.4 || ^5.1",
"willdurand/negotiation": "^2.0.3 || ^3.0"
Expand Down
45 changes: 22 additions & 23 deletions features/doctrine/search_filter.feature
Expand Up @@ -19,7 +19,7 @@ Feature: Search filter on collections
Given there is a DummyCar entity with related colors
When I send a "GET" request to "/dummy_cars?colors.prop=red"
Then the response status code should be 200
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"@context": "/contexts/DummyCar",
Expand Down Expand Up @@ -81,25 +81,25 @@ Feature: Search filter on collections
"hydra:mapping": [
{
"@type": "IriTemplateMapping",
"variable": "availableAt[after]",
"variable": "availableAt[before]",
"property": "availableAt",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "availableAt[before]",
"variable": "availableAt[strictly_before]",
"property": "availableAt",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "availableAt[strictly_after]",
"variable": "availableAt[after]",
"property": "availableAt",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "availableAt[strictly_before]",
"variable": "availableAt[strictly_after]",
"property": "availableAt",
"required": false
},
Expand All @@ -111,44 +111,38 @@ Feature: Search filter on collections
},
{
"@type": "IriTemplateMapping",
"variable": "colors",
"property": "colors",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "colors.prop",
"property": "colors.prop",
"variable": "foobar[]",
"property": null,
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "colors[]",
"property": "colors",
"variable": "foobargroups[]",
"property": null,
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "foobar[]",
"variable": "foobargroups_override[]",
"property": null,
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "foobargroups[]",
"property": null,
"variable": "colors.prop",
"property": "colors.prop",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "foobargroups_override[]",
"property": null,
"variable": "colors",
"property": "colors",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "name",
"property": "name",
"variable": "colors[]",
"property": "colors",
"required": false
},
{
Expand Down Expand Up @@ -186,6 +180,12 @@ Feature: Search filter on collections
"variable": "uuid[]",
"property": "uuid",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "name",
"property": "name",
"required": false
}
]
}
Expand Down Expand Up @@ -278,7 +278,6 @@ Feature: Search filter on collections
Then the response status code should be 200
And the response should be in JSON
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
And print last JSON response
And the JSON should be valid according to this schema:
"""
{
Expand Down
124 changes: 108 additions & 16 deletions features/graphql/introspection.feature
Expand Up @@ -71,12 +71,56 @@ Feature: GraphQL introspection support
And the response should be in JSON
And the header "Content-Type" should be equal to "application/json"
And the JSON node "data.type1.description" should be equal to "Dummy Product."
And the JSON node "data.type1.fields[1].type.name" should be equal to "DummyAggregateOfferConnection"
And the JSON node "data.type2.fields[0].name" should be equal to "edges"
And the JSON node "data.type2.fields[0].type.ofType.name" should be equal to "DummyAggregateOfferEdge"
And the JSON node "data.type3.fields[0].name" should be equal to "node"
And the JSON node "data.type3.fields[1].name" should be equal to "cursor"
And the JSON node "data.type3.fields[0].type.name" should be equal to "DummyAggregateOffer"
And the JSON node "data.type1.fields" should contain:
"""
{
"name":"offers",
"type":{
"name":"DummyAggregateOfferConnection",
"kind":"OBJECT",
"ofType":null
}
}
"""
And the JSON node "data.type2.fields" should contain:
"""
{
"name":"edges",
"type":{
"name":null,
"kind":"LIST",
"ofType":{
"name":"DummyAggregateOfferEdge",
"kind":"OBJECT"
}
}
}
"""
And the JSON node "data.type3.fields" should contain:
"""
{
"name":"node",
"type":{
"name":"DummyAggregateOffer",
"kind":"OBJECT",
"ofType":null
}
}
"""
And the JSON node "data.type3.fields" should contain:
"""
{
"name":"cursor",
"type":{
"name":null,
"kind":"NON_NULL",
"ofType":{
"name":"String",
"kind":"SCALAR"
}
}
}
"""

Scenario: Introspect types with different serialization groups for item_query and collection_query
When I send the following GraphQL request:
Expand Down Expand Up @@ -201,7 +245,7 @@ Feature: GraphQL introspection support
Then the response status code should be 200
And the response should be in JSON
And the header "Content-Type" should be equal to "application/json"
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"data": {
Expand Down Expand Up @@ -286,8 +330,17 @@ Feature: GraphQL introspection support
Then the response status code should be 200
And the response should be in JSON
And the header "Content-Type" should be equal to "application/json"
And the JSON node "data.__type.fields[9].name" should be equal to "jsonData"
And the JSON node "data.__type.fields[9].type.name" should be equal to "Iterable"
And the JSON node "data.__type.fields" should contain:
"""
{
"name":"jsonData",
"type":{
"name":"Iterable",
"kind":"SCALAR",
"ofType":null
}
}
"""

Scenario: Retrieve entity - using serialization groups - fields
When I send the following GraphQL request:
Expand Down Expand Up @@ -420,13 +473,52 @@ Feature: GraphQL introspection support
Then the response status code should be 200
And the response should be in JSON
And the header "Content-Type" should be equal to "application/json"
And the JSON node "data.typeCreatePayload.fields" should have 2 elements
And the JSON node "data.typeCreatePayload.fields[0].name" should be equal to "dummyProperty"
And the JSON node "data.typeCreatePayload.fields[0].type.name" should be equal to "createDummyPropertyPayloadData"
And the JSON node "data.typeCreatePayload.fields[1].name" should be equal to "clientMutationId"
And the JSON node "data.typeCreatePayloadData.fields[3].name" should be equal to "group"
And the JSON node "data.typeCreatePayloadData.fields[3].type.name" should be equal to "createDummyGroupNestedPayload"
And the JSON node "data.typeCreateNestedPayload.fields[0].name" should be equal to "id"
And the JSON node "data.typeCreatePayload.fields" should be equal to:
"""
[
{
"name":"dummyProperty",
"type":{
"name":"createDummyPropertyPayloadData",
"kind":"OBJECT",
"ofType":null
}
},
{
"name":"clientMutationId",
"type":{
"name":"String",
"kind":"SCALAR",
"ofType":null
}
}
]
"""
And the JSON node "data.typeCreatePayloadData.fields" should contain:
"""
{
"name":"group",
"type":{
"name":"createDummyGroupNestedPayload",
"kind":"OBJECT",
"ofType":null
}
}
"""
And the JSON node "data.typeCreateNestedPayload.fields" should contain:
"""
{
"name":"id",
"type":{
"name":null,
"kind":"NON_NULL",
"ofType":{
"name":"ID",
"kind":"SCALAR"
}
}
}
"""

Scenario: Retrieve a type name through a GraphQL query
Given there are 4 dummy objects with relatedDummy
Expand Down

0 comments on commit 32859ac

Please sign in to comment.