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

Initial proposal of @Context feature #311

Merged
merged 6 commits into from
Jul 7, 2020
Merged

Initial proposal of @Context feature #311

merged 6 commits into from
Jul 7, 2020

Conversation

phillip-kruger
Copy link
Member

This is facading some information from graphql-java's DataFetchingEnviroment and also allow leaky abstraction to the DataFetchingEnviroment via unwrap.

I am sure is more we need to move into the @Context interface, so please comment here.

I think a good test would be to see if we can create custom SQL or JPA queries using the information in Context (without having to use unwrap)

Please look at the code in API as this is what will eventually move to the spec.

Let me know what you think.

Signed-off-by:Phillip Kruger [email protected]

@phillip-kruger phillip-kruger added this to the 1.0.5 milestone Jul 1, 2020
@phillip-kruger phillip-kruger requested a review from andymc12 July 1, 2020 10:16
@phillip-kruger
Copy link
Member Author

Usage is as simple as injecting the Context anywhere you need it:

@Inject
Context context;

Signed-off-by:Phillip Kruger <[email protected]>
@phillip-kruger phillip-kruger requested a review from ybroeker July 1, 2020 10:28
@phillip-kruger phillip-kruger linked an issue Jul 1, 2020 that may be closed by this pull request
andymc12
andymc12 previously approved these changes Jul 2, 2020
Copy link
Collaborator

@andymc12 andymc12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at the test cases thoroughly, but I like the overall design. Only a few comments - neither of them are deal-breakers. Thanks @phillip-kruger!

Signed-off-by:Phillip Kruger <[email protected]>
@phillip-kruger phillip-kruger requested a review from t1 July 2, 2020 07:53
Signed-off-by:Phillip Kruger <[email protected]>
@phillip-kruger phillip-kruger marked this pull request as ready for review July 7, 2020 16:01
@phillip-kruger phillip-kruger merged commit b70cd9b into smallrye:master Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Context feature
2 participants