这是indexloc提供的服务,不要输入任何密码
Skip to content

Apollo federation _service.sdl field returns invalid schema missing scalar types #9115

@kdawgwilk

Description

@kdawgwilk

Version Information

Server Version: 2.13.0

Environment

CE edition

HASURA_GRAPHQL_EXPERIMENTAL_FEATURES=apollo_federation

What is the current behaviour?

Running

query {
  _service {
    sdl
  }
}

Returns an invalid schema that is missing scalars such as uuid

What is the expected behaviour?

The following query returns a fully valid SDL schema that passes official GraphQL spec requirements such as defining the scalar types being used in other fields

query {
  _service {
    sdl
  }
}

How to reproduce the issue?

  1. Spin up hasura instance with the experimental apollo_federation feature enabled
HASURA_GRAPHQL_EXPERIMENTAL_FEATURES=apollo_federation
  1. Run the following query
query {
  _service {
    sdl
  }
}
  1. Search generated sdl for scalar uuid

Please provide any traces or logs that could help here.

/usr/app/node_modules/@apollo/gateway/src/supergraphManagers/IntrospectAndCompose/index.ts:118
      throw Error(
            ^
Error: A valid schema couldn't be composed. The following composition errors were found:
	[hasura] Unknown type uuid

Any possible solutions?

These scalars do seem to be present when introspection the graph so there must be a difference between introspection and producing this sdl and the bug likely is due to the difference in functionality between those two

If the bug is confirmed, would you be willing to submit a PR?

I wish I knew enough Haskell to be able to do this 😞

Keywords

apollo, federation, subgraph, IntrospectAndCompose, Unknown type uuid

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions