Skip to content

Unknown directive "@oneOf". #3437

Description

@sonewman

Issue Description

This results in error, it fails at printSubgraphSchema no clue why, some validation step that can't be avoided. Schema seems to be valid when built into subgraph, composes fine.... just can't be printed

import { buildSubgraphSchema, printSubgraphSchema } from "@apollo/subgraph";
import * as GraphQL from "graphql";

const schema = buildSubgraphSchema([
  {
    typeDefs: GraphQL.parse(/* GraphQL */ `
    directive @oneOf on INPUT_OBJECT

    type Mutation {
      dummy(input: OneOfInput): String
    }

    input OneOfInput @oneOf {
      field1: String
      field2: String
    }
  `),
  },
]);

printSubgraphSchema(schema);

I am using

    "@apollo/subgraph": "^2.14.0",
    "graphql": "^16.14.0",

Link to Reproduction

Reproduction Steps

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions