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

Decouple object safe part from GraphQLType #685

Merged
merged 10 commits into from
Jun 30, 2020
Merged

Conversation

tyranron
Copy link
Member

Revealed from #682
Required for #682

Overview

Decouples object safe part of GraphQLType trait into a separate GraphQLValue trait. Does the same for GraphQLTypeAsync and GraphQLSubscriptionType too.

Motivation

This change allows to use dynamic dispatch via resolving GraphQLValue trait objects.

@tyranron tyranron self-assigned this Jun 25, 2020
@tyranron tyranron added k::api Related to API (application interface) semver::breaking Breaking change in terms of SemVer enhancement Improvement of existing features or bugfix labels Jun 25, 2020
@tyranron tyranron requested a review from LegNeato June 25, 2020 16:05
@LegNeato
Copy link
Member

Is the perf noticeable switching from static to dynamic dispatch?

@tyranron
Copy link
Member Author

@LegNeato we do not switch from static to dynanic dispatch in this PR. This PR touches nothing perf-related. It just refactors traits definitions in the way making dynamic dispatch possible to use in future. Current master doesn't allow to use dynamic dispatch at all. If you don't use dyn dispatch - you won't have it at all. And, at the moment, no code with dyn dispatch is generated, but it will be some in #682 to dispatch interfaces. I'll reason about that there.

@LegNeato
Copy link
Member

Apologies, hadn't looked at the code yet :-)

juniper/src/types/containers.rs Show resolved Hide resolved
juniper/src/types/containers.rs Show resolved Hide resolved
# Conflicts:
#	juniper/CHANGELOG.md
@tyranron tyranron force-pushed the object-safe-graphqltype branch from a6bbe78 to af26c5e Compare June 29, 2020 12:47
@tyranron tyranron merged commit 35b804c into master Jun 30, 2020
@tyranron tyranron deleted the object-safe-graphqltype branch June 30, 2020 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix k::api Related to API (application interface) semver::breaking Breaking change in terms of SemVer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants