Skip to content

Commit

Permalink
Tushar's blog post (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: Tushar Bhushan <tushar.bhushan@apollographql.com>
  • Loading branch information
tushdante and tushdante committed Jun 30, 2023
1 parent bf62370 commit 563a2d5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
12 changes: 12 additions & 0 deletions subgraphs/suggestions/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,16 @@ export const SUGGESTIONS = [
id: "flight:1"
}]
},
{
trip: {
id: "trip:1"
},
suggestions: [{
__typename: "Hotel",
id: "hotel:2"
}, {
__typename: "Flight",
id: "flight:2"
}]
},
];
2 changes: 1 addition & 1 deletion subgraphs/suggestions/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ union Product = Hotel | Flight

type Hotel @key(fields: "id", resolvable: false) { id: ID! }
type Flight @key(fields: "id", resolvable: false) { id: ID! }
type Trip @key(fields: "id", resolvable: false) { id: ID! }
type Trip @key(fields: "id", resolvable: false) { id: ID! }
5 changes: 5 additions & 0 deletions subgraphs/trips/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export const TRIPS = [
}, {
__typename: "Flight",
id: "flight:1"
}, {
__typename: "TripSuggestion",
trip: {
id: "trip:1"
}
}],
},
{
Expand Down
6 changes: 4 additions & 2 deletions subgraphs/users/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key"])
@link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key", "@tag"])

type Query {
users: [User]
Expand All @@ -8,5 +8,7 @@ type Query {

type User @key(fields: "id") {
id: ID!
name: String
name: String @tag(name: "internal")
email: String @tag(name: "internal")
phoneNumber: Int @tag(name: "internal")
}

0 comments on commit 563a2d5

Please sign in to comment.