graphql-composition 0.12.2

An implementation of GraphQL federated schema composition
Documentation
---
source: crates/graphql-composition/tests/composition_tests.rs
expression: Federated SDL
input_file: crates/graphql-composition/tests/composition/cost_basic/test.md
---
schema
  @link(url: "https://specs.apollo.dev/link/v1.0")
  @link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION)
  @link(url: "https://specs.apollo.dev/inaccessible/v0.2", for: SECURITY)
{
  query: Query
}

directive @cost(weight: Int!) on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | ENUM | INPUT_FIELD_DEFINITION

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

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

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

directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, overrideLabel: String) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION

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

directive @join__enumValue(graph: join__Graph!) on ENUM_VALUE

directive @join__owner(graph: join__Graph!) on OBJECT

scalar Foo
  @cost(weight: 6)

scalar join__FieldSet

type Account
  @cost(weight: 3)
  @join__type(graph: A)
{
  foo(name: String @cost(weight: 200)): String
  id: ID! @cost(weight: 4)
}

type Query
  @cost(weight: 1)
{
  foo(name: String @cost(weight: 100)): String @join__field(graph: A)
  id: ID! @cost(weight: 2) @join__field(graph: A)
}

enum Blah
  @cost(weight: 5)
  @join__type(graph: A)
{
  BLAH @join__enumValue(graph: A)
}

enum join__Graph
{
  A @join__graph(name: "a", url: "http://example.com/a")
}

input Bar
  @join__type(graph: A)
{
  x: String @cost(weight: 7)
}