schema
  @link(url: "https://specs.apollo.dev/link/v1.0")
  @link(url: "https://specs.apollo.dev/join/v0.5", for: EXECUTION)
  @link(url: "https://specs.apollo.dev/tag/v0.3")
  @link(url: "https://specs.apollo.dev/inaccessible/v0.2", for: SECURITY)
  @link(url: "https://specs.apollo.dev/authenticated/v0.1", for: SECURITY)
  @link(url: "https://specs.apollo.dev/requiresScopes/v0.1", for: SECURITY)
  @link(url: "https://specs.apollo.dev/policy/v0.1", for: SECURITY)
  @link(url: "https://specs.apollo.dev/context/v0.1", for: SECURITY)
  @link(url: "http://specs.example.org/custom/v0.1", import: ["@custom"])
  @link(url: "http://specs.example.org/custom2/v0.1", import: ["@custom2"])
  @link(url: "http://specs.example.org/custom3/v0.1", import: ["@custom3"])
  @link(url: "https://specs.apollo.dev/connect/v0.2", for: EXECUTION)
  @join__directive(graphs: [ONE], name: "link", args: {url: "https://specs.apollo.dev/connect/v0.1", import: ["@connect", "@source"]})
  @join__directive(graphs: [ONE], name: "source", args: {name: "json", http: {baseURL: "http://example/"}})
{
  query: Query
}

directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM

directive @context(name: String!) repeatable on INTERFACE | OBJECT | UNION

directive @context__fromContext(field: context__ContextFieldValue) on ARGUMENT_DEFINITION

directive @custom(s: custom__Scalar, e: custom__Enum, i: custom__Input) on OBJECT | FIELD_DEFINITION

directive @custom2(s: custom__Scalar2, e: custom__Enum2, i: custom__Input2) on OBJECT | FIELD_DEFINITION

directive @custom3(s: custom__Scalar3, e: custom__Enum3, i: custom__Input3) on OBJECT | FIELD_DEFINITION

directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION

directive @join__directive(graphs: [join__Graph!], name: String!, args: join__DirectiveArguments) repeatable on SCHEMA | OBJECT | INTERFACE | FIELD_DEFINITION

directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE

directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean, overrideLabel: String, contextArguments: [join__ContextArgument!]) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION

directive @join__graph(name: String!, url: String!) on ENUM_VALUE

directive @join__implements(graph: join__Graph!, interface: String!) repeatable on OBJECT | INTERFACE

directive @join__type(graph: join__Graph!, key: join__FieldSet, extension: Boolean! = false, resolvable: Boolean! = true, isInterfaceObject: Boolean! = false) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR

directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on UNION

directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA

directive @policy(policies: [[policy__Policy!]!]!) on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM

directive @requiresScopes(scopes: [[requiresScopes__Scope!]!]!) on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM

directive @tag(name: String!) repeatable on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION | SCHEMA

scalar context__ContextFieldValue

enum custom__Enum
  @join__type(graph: ONE)
  @join__type(graph: TWO)
{
  ONE @join__enumValue(graph: ONE) @join__enumValue(graph: TWO)
  TWO @join__enumValue(graph: ONE) @join__enumValue(graph: TWO)
}

enum custom__Enum2
  @join__type(graph: ONE)
{
  ONE @join__enumValue(graph: ONE)
  TWO @join__enumValue(graph: ONE)
}

enum custom__Enum3
  @join__type(graph: TWO)
{
  ONE @join__enumValue(graph: TWO)
  TWO @join__enumValue(graph: TWO)
}

input custom__Input
  @join__type(graph: ONE)
  @join__type(graph: TWO)
{
  one: String
  two: String
}

input custom__Input2
  @join__type(graph: ONE)
{
  one: String
  two: String
}

input custom__Input3
  @join__type(graph: TWO)
{
  one: String
  two: String
}

scalar custom__Scalar
  @join__type(graph: ONE)
  @join__type(graph: TWO)

scalar custom__Scalar2
  @join__type(graph: ONE)

scalar custom__Scalar3
  @join__type(graph: TWO)

input join__ContextArgument {
  name: String!
  type: String!
  context: String!
  selection: join__FieldValue!
}

scalar join__DirectiveArguments

scalar join__FieldSet

scalar join__FieldValue

enum join__Graph {
  ONE @join__graph(name: "one", url: "none")
  TWO @join__graph(name: "two", url: "none")
}

scalar link__Import

enum link__Purpose {
  """
  `SECURITY` features provide metadata necessary to securely resolve fields.
  """
  SECURITY

  """
  `EXECUTION` features provide metadata necessary for operation execution.
  """
  EXECUTION
}

scalar policy__Policy

type Query
  @join__type(graph: ONE)
  @join__type(graph: TWO)
{
  ts: [T] @join__field(graph: ONE) @join__directive(graphs: [ONE], name: "connect", args: {source: "json", http: {GET: "/t"}, selection: "id\ntagged\nhidden\ncustom\nauthenticated\nrequiresScopes\npolicy\noverridden"})
  t(id: ID): T @join__field(graph: ONE) @join__directive(graphs: [ONE], name: "connect", args: {source: "json", http: {GET: "/t/{$args.id}"}, selection: "id\ntagged\nhidden\ncustom\nauthenticated\nrequiresScopes\npolicy\noverridden", entity: true})
  z: Z @join__field(graph: TWO)
}

type R
  @join__type(graph: ONE)
{
  id: ID!
}

scalar requiresScopes__Scope

type T
  @join__type(graph: ONE, key: "id")
  @join__type(graph: TWO, key: "id")
{
  id: ID!
  tagged: TEnum @join__field(graph: ONE) @tag(name: "tag")
  hidden: String @inaccessible @join__field(graph: ONE)
  custom: String @join__field(graph: ONE) @custom @custom2
  authenticated: String @join__field(graph: ONE) @authenticated
  requiresScopes: String @join__field(graph: ONE) @requiresScopes(scopes: ["scope"])
  policy: String @join__field(graph: ONE) @policy(policies: [["admin"]])
  overridden: String @join__field(graph: ONE, override: "two", overrideLabel: "label") @join__field(graph: TWO, overrideLabel: "label")
  r: R @join__field(graph: ONE) @join__directive(graphs: [ONE], name: "connect", args: {source: "json", http: {GET: "/t/{$this.id}/r"}, selection: "id"})
}

type X
  @join__type(graph: TWO, key: "id")
{
  id: ID!
  w: String @join__field(graph: TWO, contextArguments: [{context: "two__ctx", name: "z", type: "String", selection: " { y }"}])
}

type Z
  @join__type(graph: TWO, key: "id")
  @context(name: "two__ctx")
{
  id: ID!
  y: String @custom(s: "x", e: ONE, i: {one: "one"})
  x: X @custom3(s: "x", e: ONE, i: {one: "one"})
}

enum TEnum @join__type(graph: ONE) {
  ONE
  TWO
}

input UnusedInput @join__type(graph: ONE) {
  one: String
  two: TEnum
}
