Skip to content

Decouple object safe part from GraphQLType - #685

Merged
tyranron merged 10 commits into
masterfrom
object-safe-graphqltype
Jun 30, 2020
Merged

tyranron merged 10 commits into
masterfrom
object-safe-graphqltype

Conversation

@tyranron

Copy link
Copy Markdown
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
Copy Markdown
Member

Is the perf noticeable switching from static to dynamic dispatch?

@tyranron

Copy link
Copy Markdown
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
Copy Markdown
Member

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

Comment thread juniper/src/types/containers.rs
Comment thread juniper/src/types/containers.rs
# 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