diff --git a/package.json b/package.json index cf1faed838d..d97cf0da762 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "update-graphql-docs": "graphql-markdown --header x-api-key=$API_KEY --no-toc --no-title --update-file source/graphql.md https://affiliate.publitas.com:443/graphql" + "update-graphql-docs": "graphql-markdown --header x-api-key=$API_KEY --no-toc --no-title --update-file source/graphql.html.md https://affiliate.publitas.com:443/graphql" }, "bin": { "graphql-markdown": "node_modules/.bin/graphql-markdown" diff --git a/source/graphql.html.md b/source/graphql.html.md index 37b1ab8abad..cded52b63b4 100644 --- a/source/graphql.html.md +++ b/source/graphql.html.md @@ -261,14 +261,40 @@ To get the next batch of items after the last one, the next query should include When there are no more items, the `edges` object array will be empty. +## Filtering publications + +```text +query { + publications(groupSlug: "acme", first: 25) { + edges { + cursor + node { + id + slug + title + groupSlug + } + } + } +} +``` + +The `publications` query accepts three optional filters that narrow the result set server-side: + +- `groupId` — restrict to publications in a given group +- `groupSlug` — restrict to publications in the group with this slug +- `accountId` — restrict to publications whose group belongs to this account + +Filters can be combined and are AND-ed together. They only ever narrow results within your affiliate scope and never widen visibility. Filtering by an invalid integer ID (`groupId`, `accountId`) or an empty `groupSlug` returns an empty list rather than an error. + # GraphQL References Below are the specifications for each supported field and object. -## Query +## Query
| groupId | +ID | ++ +Filter to publications belonging to this group + + | +||
| groupSlug | +String | ++ +Filter to publications belonging to the group with this slug + + | +||
| accountId | +ID | ++ +Filter to publications whose group belongs to this account + | ||
| customLabel5 | +String | ++ | ||
| customLabel6 | +String | ++ | ||
| customLabel7 | +String | ++ | ||
| customLabel8 | +String | ++ | ||
| customLabel9 | +String | ++ | ||
| description | String | @@ -802,6 +880,11 @@ A product from a hotspot | ||
| googleProductCategory | +String | ++ | ||
| gtin | String | @@ -842,6 +925,11 @@ A product from a hotspot | ||
| promotionalLabel | +String | ++ | ||
| title | String | @@ -1642,8 +1730,10 @@ Represents non-fractional signed whole numeric values. Int can represent values Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text. + ## Interfaces + ### Hotspot A hotspot that may be of several types | ||