Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
92 changes: 91 additions & 1 deletion source/graphql.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<!-- START graphql-markdown -->

## Query

## Query
<table>
<thead>
<tr>
Expand Down Expand Up @@ -360,6 +386,33 @@ Returns the first _n_ elements from the list.

Returns the last _n_ elements from the list.

</td>
</tr>
<tr>
<td colspan="2" align="right" valign="top">groupId</td>
<td valign="top"><a href="#id">ID</a></td>
<td>

Filter to publications belonging to this group

</td>
</tr>
<tr>
<td colspan="2" align="right" valign="top">groupSlug</td>
<td valign="top"><a href="#string">String</a></td>
<td>

Filter to publications belonging to the group with this slug

</td>
</tr>
<tr>
<td colspan="2" align="right" valign="top">accountId</td>
<td valign="top"><a href="#id">ID</a></td>
<td>

Filter to publications whose group belongs to this account

</td>
</tr>
</tbody>
Expand Down Expand Up @@ -792,6 +845,31 @@ A product from a hotspot
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="product.customlabel5">customLabel5</strong></td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="product.customlabel6">customLabel6</strong></td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="product.customlabel7">customLabel7</strong></td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="product.customlabel8">customLabel8</strong></td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="product.customlabel9">customLabel9</strong></td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="product.description">description</strong></td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
Expand All @@ -802,6 +880,11 @@ A product from a hotspot
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="product.googleproductcategory">googleProductCategory</strong></td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="product.gtin">gtin</strong></td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
Expand Down Expand Up @@ -842,6 +925,11 @@ A product from a hotspot
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="product.promotionallabel">promotionalLabel</strong></td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong id="product.title">title</strong></td>
<td valign="top"><a href="#string">String</a></td>
<td></td>
Expand Down Expand Up @@ -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
Expand Down
Loading