error if you try to use features that aren't done (fragments/interfaces)

This commit is contained in:
Ben Kraft
2021-04-02 16:19:50 -07:00
parent edb12e3e0a
commit 334c186944
3 changed files with 13 additions and 0 deletions
+4
View File
@@ -269,6 +269,10 @@ func (builder *typeBuilder) writeTypedef(typedef *ast.Definition, fields []field
return builder.maybeWriteUnmarshal(fields)
case ast.Interface, ast.Union:
if !allowBrokenFeatures {
return fmt.Errorf("not implemented: %v", typedef.Kind)
}
// First, write the interface type.
builder.WriteString("interface {\n")
implementsMethodName := fmt.Sprintf("implementsGraphQLInterface%v", builder.typeName)