Add support for GraphQL TypeExtensionDefinition (#2306)
parent
f96fe1ea5e
commit
af309e3acd
|
@ -209,11 +209,17 @@ function genericPrint(path, options, print) {
|
|||
]);
|
||||
}
|
||||
|
||||
case "TypeExtensionDefinition": {
|
||||
return concat(["extend ", path.call(print, "definition")]);
|
||||
}
|
||||
|
||||
case "ObjectTypeDefinition": {
|
||||
const parent = path.getParentNode();
|
||||
return concat([
|
||||
"type ",
|
||||
path.call(print, "name"),
|
||||
" = {",
|
||||
parent.kind === "TypeExtensionDefinition" ? "" : " =",
|
||||
" {",
|
||||
indent(concat([hardline, join(hardline, path.map(print, "fields"))])),
|
||||
hardline,
|
||||
"}"
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`extend.graphql 1`] = `
|
||||
extend type Feedback {
|
||||
custom_int: Int
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
extend type Feedback {
|
||||
custom_int: Int
|
||||
}
|
||||
|
||||
`;
|
||||
|
||||
exports[`object_type_def.graphql 1`] = `
|
||||
type FeedHomeStories {
|
||||
debug_info: String
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
extend type Feedback {
|
||||
custom_int: Int
|
||||
}
|
Loading…
Reference in New Issue