Initial support for GraphQL ObjectTypeDefinition (#2305)
It appears in some files inside of fb codebasemaster
parent
189027c7d3
commit
f96fe1ea5e
|
@ -209,6 +209,21 @@ function genericPrint(path, options, print) {
|
|||
]);
|
||||
}
|
||||
|
||||
case "ObjectTypeDefinition": {
|
||||
return concat([
|
||||
"type ",
|
||||
path.call(print, "name"),
|
||||
" = {",
|
||||
indent(concat([hardline, join(hardline, path.map(print, "fields"))])),
|
||||
hardline,
|
||||
"}"
|
||||
]);
|
||||
}
|
||||
|
||||
case "FieldDefinition": {
|
||||
return concat([path.call(print, "name"), ": ", path.call(print, "type")]);
|
||||
}
|
||||
|
||||
case "FragmentSpread": {
|
||||
return concat([
|
||||
"...",
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`object_type_def.graphql 1`] = `
|
||||
type FeedHomeStories {
|
||||
debug_info: String
|
||||
query_title: String
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
type FeedHomeStories = {
|
||||
debug_info: String
|
||||
query_title: String
|
||||
}
|
||||
|
||||
`;
|
|
@ -0,0 +1 @@
|
|||
run_spec(__dirname, { parser: "graphql" });
|
|
@ -0,0 +1,4 @@
|
|||
type FeedHomeStories {
|
||||
debug_info: String
|
||||
query_title: String
|
||||
}
|
Loading…
Reference in New Issue