INNER CODE UNIT · Go
TestFilterAuthorizedFields
movio/bramble · auth_test.go:65
func TestFilterAuthorizedFields(t *testing.T) {
schemaStr := `
type Movie {
id: ID!
title: String
compTitles: [Movie]
}
type Query {
movies: [Movie!]
}
`
schema := gqlparser.MustLoadSchema(&ast.Source{Input: schemaStr})
t.Run("root query authorized", func(t *testing.T) {
query := gqlparser.MustLoadQuery(schema, `query { movies {
id