From 00f27609f0661a4fc0a420683f603573c32673c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Bafrnec?= <32242542+bafko@users.noreply.github.com> Date: Fri, 18 Nov 2022 00:19:35 +0100 Subject: [PATCH] fixed "for" directive documentation (#235) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR is addressing the behavior described in #151. The former version of `for` directive example usage ended in: ``` genqlient.graphql:: for is only applicable to operations and arguments ``` I have: - [x] Written a clear PR title and description (above) - [x] Signed the [Khan Academy CLA](https://www.khanacademy.org/r/cla) - [x] Added tests covering my changes, if applicable - [x] Included a link to the issue fixed, if applicable - [x] Included documentation, for new features - [x] Added an entry to the changelog Signed-off-by: Matúš Bafrnec --- docs/CHANGELOG.md | 1 + docs/genqlient_directive.graphql | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 33d3060..c6a7827 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -30,6 +30,7 @@ When releasing a new version: - Fixed non-deterministic generated code when querying graphql interfaces. - Fixed generated code when last component of package name is not a valid identifier (e.g. `"path/to/my-package"`). +- Fixed incorrect documentation of `for` directive. ## v0.5.0 diff --git a/docs/genqlient_directive.graphql b/docs/genqlient_directive.graphql index e06945d..7ef9379 100644 --- a/docs/genqlient_directive.graphql +++ b/docs/genqlient_directive.graphql @@ -63,7 +63,9 @@ directive genqlient( # # @genqlient(for: "MyInput.myField", omitempty: true) # # @genqlient(for: "MyInput.myOtherField", pointer: true) # # @genqlient(for: "MyOutput.id", bind: "path/to/pkg.MyOutputID") - # query MyQuery($arg: MyInput) { ... } + # query MyQuery( + # $arg: MyInput + # ) { ... } # genqlient will generate a type # type MyInput struct { # MyField `json:"myField,omitempty"`