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 @@ -360,6 +386,33 @@ Returns the first _n_ elements from the list. Returns the last _n_ elements from the list. + + + + + + + + + + + + + + + + @@ -792,6 +845,31 @@ A product from a hotspot + + + + + + + + + + + + + + + + + + + + + + + + + @@ -802,6 +880,11 @@ A product from a hotspot + + + + + @@ -842,6 +925,11 @@ A product from a hotspot + + + + + @@ -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
groupIdID + +Filter to publications belonging to this group + +
groupSlugString + +Filter to publications belonging to the group with this slug + +
accountIdID + +Filter to publications whose group belongs to this account +
customLabel5String
customLabel6String
customLabel7String
customLabel8String
customLabel9String
description String
googleProductCategoryString
gtin String
promotionalLabelString
title String