smallrye / smallrye-graphql

Implementation for MicroProfile GraphQL
Apache License 2.0
155 stars 89 forks source link

Removed directive filtration, now throws an SchemaBuilding exception if the Directive Location is wrong #2127

Closed mskacelik closed 1 month ago

mskacelik commented 1 month ago

/cc @jmartisk

It was changed to be consistent with graphql-java 22.1.

If a directive is applied to the wrong location, it will throw an exception (in schema builder). Making this PR a breaking change.

On top of that in, GraphQL differentiates between input and output---types and fields)---some cases can now throw an exception. For example, here is a link: https://github.com/smallrye/smallrye-graphql/issues/1867. So if the SomeObject contains only INPUT_OBJECT directive, it will throw an exception:

@Query
public SomeObject query(SomeObject obj){/*...*/}

Some tests were added, and some were changed.

For the TypesafeStaticDirectivesClientModelTest, there was a need to make two separate model classes: 1) for client 2) for server

The previous version only had one model class with the FIELD location directive (which will fail on the server side).