error if you try to use features that aren't done (fragments/interfaces)
This commit is contained in:
@@ -12,6 +12,9 @@ import (
|
||||
"github.com/vektah/gqlparser/v2/formatter"
|
||||
)
|
||||
|
||||
// Set to true to test features that aren't yet really ready.
|
||||
var allowBrokenFeatures = false
|
||||
|
||||
var fileTemplate = mustTemplate("operation.go.tmpl")
|
||||
|
||||
// generator is the context for the codegen process (and ends up getting passed
|
||||
@@ -168,6 +171,10 @@ func Generate(config *Config) (map[string][]byte, error) {
|
||||
return nil, fmt.Errorf("no queries found in %v", config.Operations)
|
||||
}
|
||||
|
||||
if len(document.Fragments) > 0 && !allowBrokenFeatures {
|
||||
return nil, fmt.Errorf("genqlient does not yet support fragments")
|
||||
}
|
||||
|
||||
g := newGenerator(config, schema)
|
||||
for _, op := range document.Operations {
|
||||
if err = g.addOperation(op); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user