Skip to content
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

fix(graphql): wrapped type should always take the query normalization context #47

Open
wants to merge 57 commits into
base: 3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
77dc2c0
fix: update metadata for 3.0
soyuka May 3, 2022
7437a84
feat: remove core tests
soyuka May 3, 2022
d6209e9
fix: update metadata for 3.0 (mongodb)
soyuka May 3, 2022
0821efd
fix apiproperty
soyuka May 3, 2022
92ca04d
fix apifilter
soyuka May 12, 2022
cc2bba0
remove all core stuff
soyuka May 12, 2022
00a8ebb
start working on tests
soyuka May 12, 2022
0483444
chore stuff
soyuka May 12, 2022
5fcab2b
doctrine odm to attributes
soyuka May 13, 2022
59d811e
Metadata (#36)
vincentchalamon May 13, 2022
352509b
refactor(json-schema): schema factory
soyuka May 13, 2022
e5ee773
refactor(json-schema): schema factory
soyuka May 13, 2022
4ea0564
test: fix Hydra/Serializer tests (#41)
vincentchalamon May 16, 2022
817da50
tests: fix OpenApiFactory (#39)
Deuchnord May 16, 2022
628ffb9
test: OpenApi (#40)
Deuchnord May 16, 2022
d205571
test: fix Hal/Serializer tests (#38)
vincentchalamon May 16, 2022
2467d47
refactor: api loader
soyuka May 16, 2022
89c5145
crap php 7
soyuka May 16, 2022
732e2de
chore(doctrine): remove deprecated code (#42)
alanpoulain May 30, 2022
0fdc73a
Merge 2.7 into 3.0
soyuka Jun 1, 2022
939d9cd
fix some tests
soyuka Jun 1, 2022
3cfa537
test: fix Util tests
vincentchalamon May 18, 2022
65149ba
test: fix OpenApi tests
vincentchalamon May 18, 2022
098d982
test: fix Metadata tests
vincentchalamon May 18, 2022
927c964
test: fix JsonLd tests
vincentchalamon May 18, 2022
add4789
test: fix JsonApi tests
vincentchalamon May 18, 2022
8bc9450
feat: revamp ExceptionAction
vincentchalamon May 18, 2022
7df0311
chore: remove src/Core paths from phpstan
vincentchalamon May 18, 2022
a8087b9
temp
soyuka Jun 1, 2022
b2972b2
fix(json-ld): property metadata types and iris (#4769)
soyuka May 26, 2022
d329d53
most of the tests
soyuka May 30, 2022
29cf16c
compile
soyuka Jun 2, 2022
6157a98
work on behat tests
soyuka Jun 10, 2022
cc77bed
fix(graphql): type builder output (#4791)
soyuka Jun 14, 2022
7a260bd
Fix binding for ORM AbstractFilter (#4789)
dannyvw Jun 15, 2022
e6ad157
[BUG] Do not rely on api-platform/core attributes classes but on inte…
vincentchalamon Jun 15, 2022
8b666f1
fix targetentity as string-class
soyuka Jun 17, 2022
c52e1b6
doctrine + input/output
soyuka Jun 22, 2022
a33d267
fix(cache): call iriConverter only for resources
soyuka Jun 22, 2022
1fa28c2
fix(jsonapi): use skolem iris
soyuka Jun 22, 2022
91ab904
fix(symfony): catch identifiers exceptions in iri converter
soyuka Jun 22, 2022
ec4c848
fix(metadata): merge defaults arrays
soyuka Jun 22, 2022
7dcf80d
fix(test): use an operation within schema assertions
soyuka Jun 22, 2022
88419da
tests patch, rpc fix wrong iris
soyuka Jun 22, 2022
e7f3fde
fix: clear missing metadata pools (#4770)
alanpoulain May 21, 2022
a9f2ae0
fix subresource iris
soyuka Jun 23, 2022
811f4be
fixtures upgrade php8 fixes
soyuka Jun 23, 2022
1783c22
REVIEW THIS !
soyuka Jun 23, 2022
cf8b8db
fix openapi tests
soyuka Jun 23, 2022
3a07977
config but review commented
soyuka Jun 23, 2022
75855b2
forgot name openapi
soyuka Jun 23, 2022
7b474d4
chore: remove deprecated mercure publisher compiler pass (#46)
azjezz Jun 25, 2022
a18ef04
fix(openapi): aws api gateway for openapi 3.0
soyuka Jun 24, 2022
f3388ea
fix serializer + gql
soyuka Jun 25, 2022
ca6353c
ask alan
soyuka Jun 25, 2022
f37afb0
fix(graphql): wrapped type should always take the query normalization…
alanpoulain Jun 27, 2022
b164f71
test: remove group from RelatedDummy
alanpoulain Jun 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
407 changes: 5 additions & 402 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,5 @@
# Changelog

## 2.7.0-beta

Json-Ld: property metadata types and iris (#4769)
Symfony: write listener uri variables converter (#4774)
Metadata: extra properties operation inheritance (#4773)

**BC**

Doctrine: new interfaces for Filters and Extensions ready, switch to the `ApiPlatform\Doctrine` namespace after fixing your deprecations: (#4779)
- `ApiPlatform\Core\Bridge\Doctrine\Orm\Extension` interfaces have an `Operation` instead of the `$operationName`, the new namespace is `ApiPlatform\Doctrine\Orm\Extension`
- `ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension` interfaces have an `Operation` instead of the `$operationName`, the new namespace is `ApiPlatform\Doctrine\Odm\Extension`

## 2.7.0-alpha.7

Metadata: defaults deprecation (#4772)

## 2.7.0-alpha.6

GraphQl: output creates its own type in TypeBuilder (#4766)
Metadata: clear missing metadata cache pools (#4770)
Metadata: property override when value is set (#4767)
Metadata: add read and write to extractor (#4760)
JsonSchema: factory backward compatibility layer (#4758)
Metadata: defaults properly overrides metadata (#4759)
Metadata: Add missing processor and provider to extractor (#4754)

## 2.7.0-alpha.5

* Backward compatibility: fix upgrade script for subresources (#4747)
* Backward compatibility: fix dependency injection (#4748)

## 2.7.0-alpha.4

* Backward compatibility: fix dependency injection (#4744)
* Metadata: allow extra keys within defaults (#4743)

## 2.7.0-alpha.3

* Implements Skolem IRIs instead of blank nodes, can be disabled using `iri: false` (#4731)
Expand Down
128 changes: 64 additions & 64 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ default:
suites:
default:
contexts:
- 'ApiPlatform\Core\Tests\Behat\CommandContext'
- 'ApiPlatform\Core\Tests\Behat\DoctrineContext'
- 'ApiPlatform\Core\Tests\Behat\GraphqlContext'
- 'ApiPlatform\Core\Tests\Behat\JsonContext'
- 'ApiPlatform\Core\Tests\Behat\HydraContext'
- 'ApiPlatform\Core\Tests\Behat\OpenApiContext'
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\MercureContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'ApiPlatform\Tests\Behat\CommandContext'
- 'ApiPlatform\Tests\Behat\DoctrineContext'
- 'ApiPlatform\Tests\Behat\GraphqlContext'
- 'ApiPlatform\Tests\Behat\JsonContext'
- 'ApiPlatform\Tests\Behat\HydraContext'
- 'ApiPlatform\Tests\Behat\OpenApiContext'
- 'ApiPlatform\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Tests\Behat\MercureContext'
- 'ApiPlatform\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
filters:
Expand All @@ -38,17 +38,17 @@ postgres:
default: false
postgres: &postgres-suite
contexts:
- 'ApiPlatform\Core\Tests\Behat\CommandContext'
- 'ApiPlatform\Core\Tests\Behat\DoctrineContext'
- 'ApiPlatform\Core\Tests\Behat\GraphqlContext'
- 'ApiPlatform\Core\Tests\Behat\JsonContext'
- 'ApiPlatform\Core\Tests\Behat\HydraContext'
- 'ApiPlatform\Core\Tests\Behat\OpenApiContext'
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\MercureContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'ApiPlatform\Tests\Behat\CommandContext'
- 'ApiPlatform\Tests\Behat\DoctrineContext'
- 'ApiPlatform\Tests\Behat\GraphqlContext'
- 'ApiPlatform\Tests\Behat\JsonContext'
- 'ApiPlatform\Tests\Behat\HydraContext'
- 'ApiPlatform\Tests\Behat\OpenApiContext'
- 'ApiPlatform\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Tests\Behat\MercureContext'
- 'ApiPlatform\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
filters:
Expand All @@ -59,17 +59,17 @@ mongodb:
default: false
mongodb: &mongodb-suite
contexts:
- 'ApiPlatform\Core\Tests\Behat\CommandContext'
- 'ApiPlatform\Core\Tests\Behat\DoctrineContext'
- 'ApiPlatform\Core\Tests\Behat\GraphqlContext'
- 'ApiPlatform\Core\Tests\Behat\JsonContext'
- 'ApiPlatform\Core\Tests\Behat\HydraContext'
- 'ApiPlatform\Core\Tests\Behat\OpenApiContext'
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\MercureContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'ApiPlatform\Tests\Behat\CommandContext'
- 'ApiPlatform\Tests\Behat\DoctrineContext'
- 'ApiPlatform\Tests\Behat\GraphqlContext'
- 'ApiPlatform\Tests\Behat\JsonContext'
- 'ApiPlatform\Tests\Behat\HydraContext'
- 'ApiPlatform\Tests\Behat\OpenApiContext'
- 'ApiPlatform\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Tests\Behat\MercureContext'
- 'ApiPlatform\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
filters:
Expand All @@ -82,9 +82,9 @@ elasticsearch:
paths:
- '%paths.base%/features/elasticsearch'
contexts:
- 'ApiPlatform\Core\Tests\Behat\CommandContext'
- 'ApiPlatform\Core\Tests\Behat\ElasticsearchContext'
- 'ApiPlatform\Core\Tests\Behat\JsonContext'
- 'ApiPlatform\Tests\Behat\CommandContext'
- 'ApiPlatform\Tests\Behat\ElasticsearchContext'
- 'ApiPlatform\Tests\Behat\JsonContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
filters:
Expand All @@ -94,18 +94,18 @@ default-coverage:
suites:
default: &default-coverage-suite
contexts:
- 'ApiPlatform\Core\Tests\Behat\CommandContext'
- 'ApiPlatform\Core\Tests\Behat\DoctrineContext'
- 'ApiPlatform\Core\Tests\Behat\GraphqlContext'
- 'ApiPlatform\Core\Tests\Behat\JsonContext'
- 'ApiPlatform\Core\Tests\Behat\HydraContext'
- 'ApiPlatform\Core\Tests\Behat\OpenApiContext'
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\MercureContext'
- 'ApiPlatform\Core\Tests\Behat\CoverageContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'ApiPlatform\Tests\Behat\CommandContext'
- 'ApiPlatform\Tests\Behat\DoctrineContext'
- 'ApiPlatform\Tests\Behat\GraphqlContext'
- 'ApiPlatform\Tests\Behat\JsonContext'
- 'ApiPlatform\Tests\Behat\HydraContext'
- 'ApiPlatform\Tests\Behat\OpenApiContext'
- 'ApiPlatform\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Tests\Behat\MercureContext'
- 'ApiPlatform\Tests\Behat\CoverageContext'
- 'ApiPlatform\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'

Expand All @@ -115,18 +115,18 @@ mongodb-coverage:
mongodb: &mongodb-coverage-suite
<<: *mongodb-suite
contexts:
- 'ApiPlatform\Core\Tests\Behat\CommandContext'
- 'ApiPlatform\Core\Tests\Behat\DoctrineContext'
- 'ApiPlatform\Core\Tests\Behat\GraphqlContext'
- 'ApiPlatform\Core\Tests\Behat\JsonContext'
- 'ApiPlatform\Core\Tests\Behat\HydraContext'
- 'ApiPlatform\Core\Tests\Behat\OpenApiContext'
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\MercureContext'
- 'ApiPlatform\Core\Tests\Behat\CoverageContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'ApiPlatform\Tests\Behat\CommandContext'
- 'ApiPlatform\Tests\Behat\DoctrineContext'
- 'ApiPlatform\Tests\Behat\GraphqlContext'
- 'ApiPlatform\Tests\Behat\JsonContext'
- 'ApiPlatform\Tests\Behat\HydraContext'
- 'ApiPlatform\Tests\Behat\OpenApiContext'
- 'ApiPlatform\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Tests\Behat\MercureContext'
- 'ApiPlatform\Tests\Behat\CoverageContext'
- 'ApiPlatform\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'

Expand All @@ -136,9 +136,9 @@ elasticsearch-coverage:
elasticsearch: &elasticsearch-coverage-suite
<<: *elasticsearch-suite
contexts:
- 'ApiPlatform\Core\Tests\Behat\CommandContext'
- 'ApiPlatform\Core\Tests\Behat\ElasticsearchContext'
- 'ApiPlatform\Core\Tests\Behat\JsonContext'
- 'ApiPlatform\Core\Tests\Behat\CoverageContext'
- 'ApiPlatform\Tests\Behat\CommandContext'
- 'ApiPlatform\Tests\Behat\ElasticsearchContext'
- 'ApiPlatform\Tests\Behat\JsonContext'
- 'ApiPlatform\Tests\Behat\CoverageContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
11 changes: 3 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=8.1",
"doctrine/inflector": "^1.0 || ^2.0",
"fig/link-util": "^1.0",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
Expand All @@ -29,7 +29,6 @@
"require-dev": {
"behat/behat": "^3.1",
"behat/mink": "^1.9@dev",
"doctrine/annotations": "^1.7",
"doctrine/cache": "^1.11 || ^2.1",
"doctrine/common": "^2.11 || ^3.0",
"doctrine/data-fixtures": "^1.2.2",
Expand Down Expand Up @@ -115,14 +114,10 @@
"autoload": {
"psr-4": {
"ApiPlatform\\": "src/"
},
"files": [
"src/deprecation.php"
]
}
},
"autoload-dev": {
"psr-4": {
"ApiPlatform\\Core\\Tests\\": "tests/Core/",
"ApiPlatform\\Tests\\": "tests/",
"App\\": "tests/Fixtures/app/var/tmp/src/"
}
Expand All @@ -139,7 +134,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "2.7.x-dev"
"dev-main": "3.0.x-dev"
},
"symfony": {
"require": "^3.4 || ^4.4 || ^5.1 || ^6.0"
Expand Down
4 changes: 1 addition & 3 deletions features/graphql/input_output.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ Feature: GraphQL DTO input and output
"bat": "OutputDto/bat",
"relatedDummies": "OutputDto/relatedDummies"
},
"@type": "DummyDtoInputOutput",
"@id": "/dummy_dto_input_outputs/1",
"@type": "OutputDto",
"id": 1,
"baz": 1,
"bat": "test",
"relatedDummies": [
{
"@context": "/contexts/RelatedDummy",
"@id": "/related_dummies/1",
"@type": "https://schema.org/Product",
"name": "RelatedDummy with friends",
Expand Down
2 changes: 1 addition & 1 deletion features/graphql/introspection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -565,4 +565,4 @@ Feature: GraphQL introspection support
And the header "Content-Type" should be equal to "application/json"
And the JSON node "errors[0].debugMessage" should be equal to 'Type with id "VoDummyInspectionCursorConnection" is not present in the types container'
And the JSON node "data.typeNotAvailable" should be null
And the JSON node "data.typeOwner.fields[3].type.name" should be equal to "VoDummyInspectionCursorConnection"
And the JSON node "data.typeOwner.fields[1].type.name" should be equal to "VoDummyInspectionCursorConnection"
20 changes: 0 additions & 20 deletions features/graphql/mutation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -819,26 +819,6 @@ Feature: GraphQL mutation support
And the JSON node "data.testCustomArgumentsDummyCustomMutation.dummyCustomMutation.result" should be equal to "18"
And the JSON node "data.testCustomArgumentsDummyCustomMutation.clientMutationId" should be equal to "myId"

Scenario: Execute a custom mutation with output
When I send the following GraphQL request:
"""
mutation {
testOutputDummyCustomMutation(input: {id: "/dummy_custom_mutations/1", operandA: 9, clientMutationId: "myId"}) {
dummyCustomMutation {
baz
bat
}
clientMutationId
}
}
"""
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.testOutputDummyCustomMutation.dummyCustomMutation.baz" should be equal to "98"
And the JSON node "data.testOutputDummyCustomMutation.dummyCustomMutation.bat" should be equal to "9"
And the JSON node "data.testOutputDummyCustomMutation.clientMutationId" should be equal to "myId"

Scenario: Uploading a file with a custom mutation
Given I have the following file for a GraphQL request:
| name | file |
Expand Down
26 changes: 0 additions & 26 deletions features/graphql/query.feature
Original file line number Diff line number Diff line change
Expand Up @@ -432,32 +432,6 @@ Feature: GraphQL query support
}
"""

Scenario: Custom item query with output
Given there are 2 dummyCustomQuery objects
When I send the following GraphQL request:
"""
{
testItemOutputDummyCustomQuery(id: "/dummy_custom_queries/1",) {
baz
bat
}
}
"""
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 equal to:
"""
{
"data": {
"testItemOutputDummyCustomQuery": {
"baz": 46,
"bat": "Success!"
}
}
}
"""

@createSchema
Scenario: Retrieve an item with different serialization groups for item_query and collection_query
Given there are 1 dummy with different GraphQL serialization groups objects
Expand Down
16 changes: 0 additions & 16 deletions features/hal/input_output.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Feature: HAL DTO input and output
In order to use a hypermedia API
As a client software developer
I need to be able to use DTOs on my resources as Input or Output objects.
TODO: in 3.0 we should change the generated IRIs, /dummy_dto_custom_output/1 should retrieve /dummy_dto_custom_output/1 not /dumy_dto_customs/1
for the collection we can search for an Operation with the same Output class as the given one for the collection

Background:
Expand All @@ -18,11 +17,6 @@ Feature: HAL DTO input and output
And the JSON should be a superset of:
"""
{
"_links": {
"self": {
"href": "/dummy_dto_customs/1"
}
},
"foo": "test",
"bar": 1
}
Expand All @@ -41,20 +35,10 @@ Feature: HAL DTO input and output
"_embedded": {
"item": [
{
"_links": {
"self": {
"href": "/dummy_dto_customs/1"
}
},
"foo": "test",
"bar": 1
},
{
"_links": {
"self": {
"href": "/dummy_dto_customs/2"
}
},
"foo": "test",
"bar": 2
}
Expand Down
Loading