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

Satisfiability validation rule for non-intersecting runtime types in different subgraphs #140

Open
dariuszkuc opened this issue Jan 16, 2025 · 1 comment

Comments

@dariuszkuc
Copy link

Given following schemas

  1. Interface example
// subgraph A
type Query {
  a: A @shareable
}

interface A {
  x: Int
}

type I1 implements A {
  x: Int
  i1: Int
}
// subgraph B
type Query {
  a: A @shareable
}

interface A {
  x: Int
}

type I2 implements A {
  x: Int
  i2: Int
}
  1. Union Example
// subgraph A
type Query {
  e: E! @shareable
}

type E @key(fields: "id") {
  id: ID!
  s: U! @shareable
}

union U = A | B

type A {
  a: Int
}

type B {
  b: Int
}
// subgraph B
type E @key(fields: "id") {
  id: ID!
  s: U! @shareable
}

union U = C | D

type C {
  c: Int
}

type D {
  d: Int
}

Both examples above should result in a satisfiability error.

Apollo tests: link

@glen-84
Copy link
Contributor

glen-84 commented Jan 26, 2025

What is meant by "non-intersecting" here? I1 and I2 intersect on field x – must they have exactly the same set of fields?

It's possible that this could be implemented as a post-merge validation rule instead of a satisfiability validation rule.

For the union example, there's no intersection of member types, so I don't think that the union type would be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants