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

fix(gatsby): Resolve linked interfaces consistently with object and union types #21936

Merged
merged 2 commits into from
Mar 4, 2020

Conversation

vladar
Copy link
Contributor

@vladar vladar commented Mar 3, 2020

Description

This PR fixes a performance issue with resolving of linked interface fields. We've discovered that

type Foo {
   bar: [InterfaceType] @link(by: "id", from: "bar___NODE")
}

Is much slower than

type Foo {
   bar: [ObjectType] @link(by: "id", from: "bar___NODE")
}

We had a special path for interfaces which was introduced in #17942

But this doesn't seem necessary anymore. Tests are passing without it. Tried this PR on a local project with schema customization. It gave a 10x speed increase for this kind of query.

Documentation

N/A - this is a performance fix

Related issues:

kontent-ai/gatsby-packages#107

@vladar vladar requested a review from a team as a code owner March 3, 2020 16:18
@vladar vladar force-pushed the vladar/iface-link-perf-fix branch from 0827764 to a6bc350 Compare March 3, 2020 16:34
Copy link
Contributor

@pvdz pvdz left a comment

Choose a reason for hiding this comment

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

💯

@sidharthachatterjee sidharthachatterjee merged commit bd5bdd1 into master Mar 4, 2020
@sidharthachatterjee sidharthachatterjee deleted the vladar/iface-link-perf-fix branch March 4, 2020 08:07
@sidharthachatterjee
Copy link
Contributor

Published in gatsby@2.19.28

Thanks @vladar ❤️

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.

3 participants