Skip to content

Commit

Permalink
Add node directive to apollo federation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
angrykoala committed Nov 19, 2024
1 parent ed732e2 commit 3444c9c
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const typeDefs = gql`
directive @custom on OBJECT
type Product @custom @key(fields: "id") @key(fields: "sku package") @key(fields: "sku variation { id }") {
type Product @custom @key(fields: "id") @key(fields: "sku package") @key(fields: "sku variation { id }") @node {
id: ID!
sku: String
package: String
Expand Down Expand Up @@ -75,18 +75,18 @@ export const typeDefs = gql`
research: [ProductResearch!]! @relationship(type: "HAS_RESEARCH", direction: OUT)
}
type DeprecatedProduct @key(fields: "sku package") {
type DeprecatedProduct @key(fields: "sku package") @node {
sku: String!
package: String!
reason: String
createdBy: [User!]! @relationship(type: "CREATED_BY", direction: OUT)
}
type ProductVariation {
type ProductVariation @node {
id: ID!
}
type ProductResearch @key(fields: "study { caseNumber }") {
type ProductResearch @key(fields: "study { caseNumber }") @node {
study: CaseStudy!
@cypher(
statement: """
Expand All @@ -98,12 +98,12 @@ export const typeDefs = gql`
outcome: String
}
type CaseStudy {
type CaseStudy @node {
caseNumber: ID!
description: String
}
type ProductDimension @shareable {
type ProductDimension @shareable @node {
size: String
weight: Float
unit: String @inaccessible
Expand All @@ -122,7 +122,7 @@ export const typeDefs = gql`
# Should be extend type as below
# extend type User @key(fields: "email") {
type User @key(fields: "email") @extends {
type User @key(fields: "email") @node @extends {
averageProductsCreatedPerYear: Int @requires(fields: "totalProductsCreated yearsOfEmployment")
email: ID! @external
name: String @override(from: "users")
Expand Down

0 comments on commit 3444c9c

Please sign in to comment.