Skip to content

Commit

Permalink
docs: update documentation about Datasource and DatasourceEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuelgsouza committed Jul 31, 2020
1 parent 0117f3b commit 6cb4dde
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ This lets you for example to query for a specific component:
}
```

### Datasources (without the entries)
### Datasources

```GraphQL
allStoryblokDatasource(filter: {data_source: {eq: null}}) {
allStoryblokDatasource {
edges {
node {
id
Expand All @@ -217,16 +217,35 @@ allStoryblokDatasource(filter: {data_source: {eq: null}}) {
}
```

### Datasource Entries by specific Datasource
### Datasource Entries

This will return all datasources, with or not dimensions values:

```GraphQL
allStoryblokDatasourceEntry(filter: { data_source: { eq: "DATASOURCE_SLUG" } }) {
edges {
node {
id
name
value
data_source
data_source_dimension
}
}
}
```

If you want to **filter by a specific dimension**, you should use:

```GraphQL
allStoryblokDatasource(filter: { data_source: { eq: "DATASOURCE_SLUG" } }) {
allStoryblokDatasourceEntry(filter: { data_source: { eq: "DATASOURCE_SLUG" }, data_source_dimension: { eq: "DATASOURCE_DIMENSION_VALUE" } }) {
edges {
node {
id
name
value
data_source
data_source_dimension
}
}
}
Expand Down

0 comments on commit 6cb4dde

Please sign in to comment.