GraphQL: Support object definition implements (#2307)
This commit is contained in:
1 parent
ee07ff5870
commit
fbf4c3a952
3 files changed
+20
-2
No files matched your search
@@ -214,12 +214,19 @@ function genericPrint(path, options, print) {
|
||||
}
|
||||
|
||||
case "ObjectTypeDefinition": {
|
||||
const parent = path.getParentNode();
|
||||
return concat([
|
||||
"type ",
|
||||
path.call(print, "name"),
|
||||
n.interfaces && n.interfaces.length > 0
|
||||
? concat([" implements ", join(", ", path.map(print, "interfaces"))])
|
||||
: "",
|
||||
printDirectives(path, print, n),
|
||||
" {",
|
||||
indent(concat([hardline, join(hardline, path.map(print, "fields"))])),
|
||||
n.fields && n.fields.length > 0
|
||||
? indent(
|
||||
concat([hardline, join(hardline, path.map(print, "fields"))])
|
||||
)
|
||||
: "",
|
||||
hardline,
|
||||
"}"
|
||||
]);
|
||||
|
||||
@@ -11,6 +11,15 @@ extend type Feedback {
|
||||
|
||||
`;
|
||||
|
||||
exports[`implements.graphql 1`] = `
|
||||
type VRMConversation implements Node, Entity @foo {
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
type VRMConversation implements Node, Entity @foo {
|
||||
}
|
||||
|
||||
`;
|
||||
|
||||
exports[`object_type_def.graphql 1`] = `
|
||||
type FeedHomeStories {
|
||||
debug_info: String
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
type VRMConversation implements Node, Entity @foo {
|
||||
}
|
||||
Reference in new issue
Block a user