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
type User
@goExtraField(
name: "Session"
type: "github.com/author/mypkg.Session"
description: "A Session used by this user"
overrideTags: "xml:\"session\""
)
@goExtraField(name: "Activated", type: "bool")
@goExtraField(
type: "time.Time"
description: "type without name will be embedded"
) {
id: ID
name: String
}
One solution could be to add a new directive, goExtraFields, which takes a list of fields. I don't know if directives can take lists of objects though.
What happened?
I ran a linter against a schema that uses the @goExtraField directive more than once for the same type.
I hit this error:
Defined here: https://github.com/graphql/graphql-js/blob/75dca3dd18e5be3031416965049fbde48a5adb20/src/validation/rules/UniqueDirectivesPerLocationRule.ts
The graphql spec considers this invalid: https://spec.graphql.org/draft/#sec-Directives-Are-Unique-per-Location
What did you expect?
I expected it to pass
Minimal graphql.schema and models to reproduce
https://gqlgen.com/recipes/extra_fields/#:~:text=type%20User%0A%09%40goExtraField,%3A%20String%0A%7D
versions
n/a
The text was updated successfully, but these errors were encountered: