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/cost/v0.1", import: ["@listSize"])
  @link(url: "https://specs.apollo.dev/cacheTag/v0.1", for: EXECUTION)
  @link(url: "https://specs.apollo.dev/context/v0.1", for: SECURITY)
  @link(url: "http://specs.example.org/custom/v0.1", import: ["@custom1", "@custom2", {name: "@originalName", as: "@custom3"}])
  @link(url: "http://bugfix/weird/v1.0", import: ["@weird"])
{
  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 @cost(weight: Int!) on ARGUMENT_DEFINITION | ENUM | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | OBJECT | SCALAR

directive @custom1 on OBJECT | FIELD_DEFINITION

directive @custom2 on OBJECT | FIELD_DEFINITION

directive @custom3 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 @listSize(assumedSize: Int, slicingArguments: [String!], sizedFields: [String!], requireOneSlicingArgument: Boolean = true) on FIELD_DEFINITION

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

directive @weird on FIELD | FIELD_DEFINITION

scalar context__ContextFieldValue

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)
{
  tagged: String @join__field(graph: ONE) @tag(name: "tag")
  hidden: String @inaccessible @join__field(graph: ONE)
  custom: T @join__field(graph: ONE) @custom1
  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") @join__directive(graphs: [ONE], name: "federation__cacheTag", args: {format: "hello"})
  weird: [String] @join__field(graph: ONE) @weird @listSize(assumedSize: 99)
  customAgain: String @join__field(graph: TWO) @join__directive(graphs: [TWO], name: "federation__cacheTag", args: {format: "goodbye"}) @custom1
  z: Z @join__field(graph: TWO)
}

scalar requiresScopes__Scope

type T
  @join__type(graph: ONE)
  @custom2
{
  field: String @custom3 @cost(weight: 5)
}

enum UnusedEnum
  @join__type(graph: ONE)
  @inaccessible
{
  A @join__enumValue(graph: ONE)
  B @join__enumValue(graph: ONE)
}

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
  x: X
}
