rover icon indicating copy to clipboard operation
rover copied to clipboard

Error at generating super-graph for federation 2.0: argument "fields" should have type "_FieldSet!" but found type "FieldSet!"

Open kirill-d-lappo opened this issue 11 months ago • 0 comments

Description

I am having error at generating supergraph schema with rover on my dev env.

The schema was generated for federation v 2.0 using hotchocolate packages with apollo federation package in dotnet service

I set federation_version: "=2.0.0" in rover configuration, and the schema is for v2 (as I understand) but rover shows errors.

Steps to reproduce

  1. Prepare a schema (or subgraph service with such a schema) for federation 2.0 where key, provides and requires directive definitions look like that:

    directive @key(fields: FieldSet! resolvable: Boolean = true) repeatable on OBJECT | INTERFACE
    directive @provides(fields: FieldSet!) on FIELD_DEFINITION
    directive @requires(fields: FieldSet!) on FIELD_DEFINITION
    
  2. Prepare rover config file (./rover.yaml):

    federation_version: "=2.0.0"
    subgraphs:
      subgraph-name:
        routing_url: http://localhost:8084/graphql
        schema:
          subgraph_url: http://localhost:8084/graphql?sdl
    
  3. Run rover with command:

    rover supergraph compose --config "./rover.yaml" --output "./supergraph.yaml"
    

Expected result

Rover must generate supergraph scheme using provided subgraphs

Actual result

Errors happens

⌛ resolving SDL for subgraphs defined in ./config.rover.localhost.yaml
🎶 composing supergraph with Federation v2.0.0
error[E029]: Encountered 6 build errors while trying to build a supergraph.

Caused by:
    UNKNOWN: [subgraph-name] Invalid definition for directive "@key": argument "fields" should have type "_FieldSet!" but found type "FieldSet!"
    UNKNOWN: [subgraph-name] Invalid definition for directive "@requires": argument "fields" should have type "_FieldSet!" but found type "FieldSet!"
    UNKNOWN: [subgraph-name] Invalid definition for directive "@provides": argument "fields" should have type "_FieldSet!" but found type "FieldSet!"

Environment

Rover Version: 0.21.0 (same for 0.23.0-rc.3) Install Location: /home/klappo/.rover/bin/rover OS: Linux Mint 21.3 (virginia) [64-bit] Shell: /bin/bash Installation method: script and binary download

kirill-d-lappo avatar Mar 05 '24 17:03 kirill-d-lappo