You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the custom selection set can only be defined during client API definition time (statically set with SelectionSet annotation in the GraphQL operation method). However, sometimes applications might need to set custom selection sets per method call. In order to support this use case, SelectionSet annotation can be enhanced as follows:
SelectionSet annotation should be modified to be applicable to method parameters as well.
Mocca should recognize the presence of a String parameter annotated with SelectionSet in the GraphQL operation method, and use it to define the selection set.
A MoccaException exception should be thrown in the following cases:
If SelectionSet is present at both method and parameter level
If SelectionSet annotated more than one parameter
If the SelectionSet annotated parameter is not a String
If SelectionSetignore field is set when used to annotate a String parameter
Important note
Similarly to when applying SelectionSet to the return type, but defining it statically as a String, if the custom selection set defined in the parameter does not match the return type, then an exception should be thrown. Developing this behavior is out of scope for this story, as it is already implemented. However, negative tests should be added to exercise this situation.
Acceptance Criteria
Use case described above is implemented
End user document is changed accordingly
Javadocs are changed accordingly
Unit and/or functional tests are added
Make sure to add negative tests as well
The text was updated successfully, but these errors were encountered:
fabiocarvalho777
changed the title
Enhance SelectionSet annotation
Allow SelectionSet to be defined during method call
Aug 10, 2021
Currently the custom selection set can only be defined during client API definition time (statically set with
SelectionSet
annotation in the GraphQL operation method). However, sometimes applications might need to set custom selection sets per method call. In order to support this use case,SelectionSet
annotation can be enhanced as follows:SelectionSet
annotation should be modified to be applicable to method parameters as well.SelectionSet
in the GraphQL operation method, and use it to define the selection set.MoccaException
exception should be thrown in the following cases:SelectionSet
is present at both method and parameter levelSelectionSet
annotated more than one parameterSelectionSet
annotated parameter is not a StringSelectionSet
ignore
field is set when used to annotate a String parameterImportant note
Similarly to when applying
SelectionSet
to the return type, but defining it statically as aString
, if the custom selection set defined in the parameter does not match the return type, then an exception should be thrown. Developing this behavior is out of scope for this story, as it is already implemented. However, negative tests should be added to exercise this situation.Acceptance Criteria
The text was updated successfully, but these errors were encountered: