Skip to content

Commit

Permalink
GraphQL: Print directives for field declarations (#2317)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeux committed Jun 28, 2017
1 parent 45c8e40 commit b231948
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/printer-graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ function genericPrint(path, options, print) {
)
: "",
": ",
path.call(print, "type")
path.call(print, "type"),
printDirectives(path, print, n)
]);
}

Expand Down
11 changes: 11 additions & 0 deletions tests/graphql_object_type_def/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ type Video {
`;

exports[`directives.graphql 1`] = `
type PokemonType {
pokemon_type: String @mock(value: "Electric")
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
type PokemonType {
pokemon_type: String @mock(value: "Electric")
}
`;

exports[`extend.graphql 1`] = `
extend type Feedback {
custom_int: Int
Expand Down
3 changes: 3 additions & 0 deletions tests/graphql_object_type_def/directives.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type PokemonType {
pokemon_type: String @mock(value: "Electric")
}

0 comments on commit b231948

Please sign in to comment.