From 1a18cf7fce3affa4a0db908ef38ac080b1162214 Mon Sep 17 00:00:00 2001 From: Tim Kendall Date: Mon, 6 Jan 2020 10:20:25 -0800 Subject: [PATCH] =?UTF-8?q?GraphQL:=20Support=20repeatable=20directive=20d?= =?UTF-8?q?efinition=20printing=20(clos=E2=80=A6=20(#7227)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/language-graphql/printer-graphql.js | 1 + tests/graphql_directive_decl/__snapshots__/jsfmt.spec.js.snap | 4 ++++ tests/graphql_directive_decl/directive_decl.graphql | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/language-graphql/printer-graphql.js b/src/language-graphql/printer-graphql.js index 70f0df48a..9ee35aa48 100644 --- a/src/language-graphql/printer-graphql.js +++ b/src/language-graphql/printer-graphql.js @@ -380,6 +380,7 @@ function genericPrint(path, options, print) { ]) ) : "", + n.repeatable ? " repeatable" : "", concat([" on ", join(" | ", path.map(print, "locations"))]) ]); } diff --git a/tests/graphql_directive_decl/__snapshots__/jsfmt.spec.js.snap b/tests/graphql_directive_decl/__snapshots__/jsfmt.spec.js.snap index 868f52f0f..15439bb2b 100644 --- a/tests/graphql_directive_decl/__snapshots__/jsfmt.spec.js.snap +++ b/tests/graphql_directive_decl/__snapshots__/jsfmt.spec.js.snap @@ -12,8 +12,10 @@ directive @a(as: String = 1) on QUERY directive @a(as: String, b: Int!) on QUERY directive @a(as: String! = 1 @deprecated) on QUERY directive @a(as: String! = 1 @deprecated) on QUERY | MUTATION +directive @a(as: String! = 1 @deprecated) repeatable on QUERY | MUTATION directive @a on QUERY +directive @a repeatable on QUERY directive @a(as: String) on QUERY @@ -30,8 +32,10 @@ directive @a(as: String = 1) on QUERY directive @a(as: String, b: Int!) on QUERY directive @a(as: String! = 1 @deprecated) on QUERY directive @a(as: String! = 1 @deprecated) on QUERY | MUTATION +directive @a(as: String! = 1 @deprecated) repeatable on QUERY | MUTATION directive @a on QUERY +directive @a repeatable on QUERY directive @a(as: String) on QUERY diff --git a/tests/graphql_directive_decl/directive_decl.graphql b/tests/graphql_directive_decl/directive_decl.graphql index 531c6112f..318e0552b 100644 --- a/tests/graphql_directive_decl/directive_decl.graphql +++ b/tests/graphql_directive_decl/directive_decl.graphql @@ -4,8 +4,10 @@ directive @a(as: String = 1) on QUERY directive @a(as: String, b: Int!) on QUERY directive @a(as: String! = 1 @deprecated) on QUERY directive @a(as: String! = 1 @deprecated) on QUERY | MUTATION +directive @a(as: String! = 1 @deprecated) repeatable on QUERY | MUTATION directive @a on QUERY +directive @a repeatable on QUERY directive @a(as: String) on QUERY