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

Preserve default values for input object fields when extracting subgraph #2218

Conversation

cysp
Copy link
Contributor

@cysp cysp commented Oct 26, 2022

Preserve default values for input object fields when extracting subgraph from super graph

Fixes #2174.

The previous attempt at this problem in #2176 took the default value of an input object field into account when validating a query document against the schema, but it turns out that input object fields' default values are being dropped before we get to that point, when we extract a subgraph from the supergraph.
This code change solves my problem in practice. 🙂

@netlify
Copy link

netlify bot commented Oct 26, 2022

👷 Deploy request for apollo-federation-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 6f02b6a

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 26, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@cysp cysp force-pushed the fix/extract-subgraph-input-field-default-value branch from 6ec0956 to d643431 Compare October 26, 2022 07:45
Copy link
Contributor

@pcmanus pcmanus left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the patch, and sorry again for missing that. Would you mind adding a quick entry in gateway-js/changelog before we merge it (I would do it, but I don't think I can push to your own repo)?

@cysp cysp force-pushed the fix/extract-subgraph-input-field-default-value branch from d643431 to 6f02b6a Compare October 26, 2022 10:11
@cysp
Copy link
Contributor Author

cysp commented Oct 26, 2022

Sure no worries, I used about the same wording as I used in the PR title here but if you have other ideas about wording I believe you can modify this branch (I've ticked a box that sounds like it allows that, "allow edits by maintainers") 🙂

@pcmanus pcmanus merged commit c33cc19 into apollographql:main Oct 26, 2022
@cysp cysp deleted the fix/extract-subgraph-input-field-default-value branch October 26, 2022 12:12
pcmanus pushed a commit that referenced this pull request Nov 2, 2022
* Release (#2215)

- @apollo/composition@2.1.4
 - apollo-federation-integration-testsuite@2.1.4
 - @apollo/gateway@2.1.4
 - @apollo/federation-internals@2.1.4
 - @apollo/query-graphs@2.1.4
 - @apollo/query-planner@2.1.4
 - @apollo/subgraph@2.1.4

* Preserve default values for input object fields when extracting subgraph (#2218)

* Update opentelemetry.mdx comment for default Collector URL (#2221)

According to https://www.npmjs.com/package/@opentelemetry/exporter-trace-otlp-http, the default URL used by this particular constructor is http://localhost:4318/v1/traces. This updated comment should be more correct and explicit, in that we also expect a default path of `/v1/traces`

* changelog entries got a little mixed up

Co-authored-by: Jeff Jakub <jeffjakub@users.noreply.github.com>
Co-authored-by: Scott Talbot <s@chikachow.org>
Co-authored-by: Kevin Lin <kevin.lin@flexport.com>
@pcmanus pcmanus linked an issue Nov 3, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants