vektah / gqlparser

A port of the parser from graphql-js into golang
MIT License
498 stars 123 forks source link

Can I get the value of a directive on the schema? #260

Closed jarrod-mg closed 1 month ago

jarrod-mg commented 1 year ago

What happened?

I think this might not be a supported feature; but I'm hoping there is a way to do this...

I provided a schema like the one below, and loaded it with LoadSchema.

What did you expect?

I expected to be able to get the value "myName" out of the *ast.Schema, somehow.

Minimal graphql.schema and models to reproduce

directive @myTag(name: String) on SCHEMA
schema @myTag(name: myName) {
    query: Query
}
type Query {
    thing (
        input: ThingInput
    ): ThingOutput
}
input ThingInput {
    id: ID
}
type ThingOutput {
    id: ID
}

versions

github.com/vektah/gqlparser/v2 v2.5.3
go version go1.20.5 linux/amd64