You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using multiple @link directives is required by the use of @composeDirective (following instructions from Apollo's documentation).
As a workaround, we can add the following to gqlgen's YAML configuration:
federation:
version: 2
What did you expect?
The issue comes from the regular expression (?s)@link.*\(.*url:.*?"(.*?)"[^)]+\) that is used by gqlgen to "guess" the Apollo Federation version.
This regular expression is too "broad" and matches everything between the beginning of the first @link directive and the end of the last @link directive:
What happened?
gqlgen 0.17.57 fails to run on my schema with the following stack trace:
This is caused by the use of two
@link
directives:Using multiple
@link
directives is required by the use of@composeDirective
(following instructions from Apollo's documentation).As a workaround, we can add the following to gqlgen's YAML configuration:
What did you expect?
The issue comes from the regular expression
(?s)@link.*\(.*url:.*?"(.*?)"[^)]+\)
that is used by gqlgen to "guess" the Apollo Federation version.This regular expression is too "broad" and matches everything between the beginning of the first
@link
directive and the end of the last@link
directive:I suggest to use a regular expression that matches the official link URL:
https://specs.apollo.dev/federation/v(\d+)\.(\d+)
.Minimal graphql.schema and models to reproduce
See example schema above.
versions
go run github.com/99designs/gqlgen version
?v0.17.57
go version
?go version go1.23.3 darwin/amd64
The text was updated successfully, but these errors were encountered: