Skip to content

Commit ebe56f2

Browse files
authored
dev: fix local federated schema seeds (#6421)
1 parent 4c022fe commit ebe56f2

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

scripts/seed-local-env.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ const publishMutationDocument =
175175
async function federation() {
176176
const instance = createInstance(null);
177177
const schemaInventory = /* GraphQL */ `
178+
extend schema
179+
@link(
180+
url: "https://specs.apollo.dev/federation/v2.3"
181+
import: ["@key", "@shareable", "@external", "@requires"]
182+
)
178183
type Product implements ProductItf @key(fields: "id") {
179184
id: ID!
180185
dimensions: ProductDimension @external
@@ -205,6 +210,7 @@ async function federation() {
205210
`;
206211

207212
const schemaPandas = /* GraphQL */ `
213+
extend schema @link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@tag"])
208214
directive @tag(name: String!) repeatable on FIELD_DEFINITION
209215
210216
type Query {
@@ -219,6 +225,11 @@ async function federation() {
219225
`;
220226

221227
const schemaProducts = /* GraphQL */ `
228+
extend schema
229+
@link(
230+
url: "https://specs.apollo.dev/federation/v2.3"
231+
import: ["@key", "@shareable", "@inaccessible", "@tag"]
232+
)
222233
directive @myDirective(a: String!) on FIELD_DEFINITION
223234
directive @hello on FIELD_DEFINITION
224235
@@ -277,6 +288,12 @@ async function federation() {
277288
`;
278289

279290
const schemaReviews = /* GraphQL */ `
291+
extend schema
292+
@link(
293+
url: "https://specs.apollo.dev/federation/v2.3"
294+
import: ["@key", "@shareable", "@override"]
295+
)
296+
280297
type Product implements ProductItf @key(fields: "id") {
281298
id: ID!
282299
reviewsCount: Int!
@@ -302,12 +319,14 @@ async function federation() {
302319
`;
303320

304321
const schemaUsers = /* GraphQL */ `
322+
extend schema
323+
@link(url: "https://specs.apollo.dev/federation/v2.3", import: ["@key", "@tag", "@shareable"])
305324
directive @tag(name: String!) repeatable on FIELD_DEFINITION | OBJECT
306325
307326
type User @key(fields: "email") {
308327
email: ID! @tag(name: "test-from-users")
309328
name: String
310-
totalProductsCreated: Int
329+
totalProductsCreated: Int @shareable
311330
createdAt: DateTime
312331
}
313332

0 commit comments

Comments
 (0)