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

chore(federation): Update schema printers #996

Merged
merged 4 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const typeDefs = gql`
inheritMaxAge: Boolean
) on FIELD_DEFINITION | OBJECT | INTERFACE | UNION
scalar JSON @specifiedBy(url: "https://json-spec.dev")
schema {
query: RootQuery
mutation: Mutation
Expand Down Expand Up @@ -65,7 +67,11 @@ export const typeDefs = gql`
}
type Mutation {
login(username: String!, password: String!): User
login(
username: String!
password: String!
userId: String @deprecated(reason: "Use username instead")
): User
}
extend type Library @key(fields: "id") {
Expand Down
1 change: 1 addition & 0 deletions federation-js/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
> The changes noted within this `vNEXT` section have not been released yet. New PRs and commits which introduce changes should include an entry in this `vNEXT` section as part of their development. When a release is being prepared, a new header will be (manually) created below and the appropriate changes within that release will be moved into the new section.
- Remove composition responsibilities from supergraph printer. Fix schema sorting for sub- and super-graphs. [PR #1000](https://github.com/apollographql/federation/pull/1000)
- Update our subgraph and supergraph schema printers to match the printSchema function from graphql-js as closely as possible. Introduce printing capabilities for the @specifiedBy directive as well as @deprecated on input values. [PR #996](https://github.com/apollographql/federation/pull/996)

## v0.30.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ describe('printSubgraphSchema', () => {
PRIVATE
}

scalar JSON @specifiedBy(url: \\"https://json-spec.dev\\")

type PasswordAccount @key(fields: \\"email\\") {
email: String!
}
Expand Down Expand Up @@ -54,7 +56,7 @@ describe('printSubgraphSchema', () => {
}

type Mutation {
login(username: String!, password: String!): User
login(username: String!, password: String!, userId: String @deprecated(reason: \\"Use username instead\\")): User
}

extend type RootQuery {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ describe('printSupergraphSdl', () => {
url: String!
}

scalar JSON @specifiedBy(url: \\"https://json-spec.dev\\")

type KeyValue {
key: String!
value: String!
Expand All @@ -160,7 +162,7 @@ describe('printSupergraphSdl', () => {

type Mutation {
deleteReview(id: ID!): Boolean @join__field(graph: REVIEWS)
login(password: String!, username: String!): User @join__field(graph: ACCOUNTS)
login(password: String!, userId: String @deprecated(reason: \\"Use username instead\\"), username: String!): User @join__field(graph: ACCOUNTS)
reviewProduct(body: String!, upc: String!): Product @join__field(graph: REVIEWS)
updateReview(review: UpdateReviewInput!): Review @join__field(graph: REVIEWS)
}
Expand Down