Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,7 @@ func TestExecutor(t *testing.T) {
args {
...InputValue
}
onOperation
onFragment
onField
locations
}
}
}
Expand Down Expand Up @@ -901,11 +899,9 @@ func TestExecutor(t *testing.T) {
},
},
},
"locations": []interface{}{"FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"},
"description": "Conditionally exclude a field or fragment during execution",
"name": "skip",
"onField": true,
"onFragment": true,
"onOperation": false,
},
map[string]interface{}{
"args": []interface{}{
Expand All @@ -923,11 +919,9 @@ func TestExecutor(t *testing.T) {
},
},
},
"locations": []interface{}{"FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"},
"description": "Conditionally include a field or fragment during execution",
"name": "include",
"onField": true,
"onFragment": true,
"onOperation": false,
},
},
"mutationType": interface{}(nil),
Expand Down
33 changes: 24 additions & 9 deletions schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,29 @@ enum __TypeKind {
type __Directive {
name: String!
description: String
locations: [__DirectiveLocation!]!
args: [__InputValue!]!
onOperation: Boolean!
onFragment: Boolean!
onField: Boolean!
}

enum __DirectiveLocation {
QUERY
MUTATION
SUBSCRIPTION
FIELD
FRAGMENT_DEFINITION
FRAGMENT_SPREAD
INLINE_FRAGMENT
SCHEMA
SCALAR
OBJECT
FIELD_DEFINITION
ARGUMENT_DEFINITION
INTERFACE
UNION
ENUM
ENUM_VALUE
INPUT_OBJECT
INPUT_FIELD_DEFINITION
}
`

Expand Down Expand Up @@ -283,9 +302,7 @@ func NewSchema(schemaDefinition string, queryRoot string, mutationRoot string) (
},
},
},
"onOperation": false,
"onField": true,
"onFragment": true,
"locations": []string{"FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"},
},
{
"name": "include",
Expand All @@ -304,9 +321,7 @@ func NewSchema(schemaDefinition string, queryRoot string, mutationRoot string) (
},
},
},
"onOperation": false,
"onField": true,
"onFragment": true,
"locations": []string{"FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"},
},
},
}
Expand Down