mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
docs: example graphql query dynamic zone
Following the issue #4849 - I add an example about the query to do to fetch DZ data.
This commit is contained in:
parent
f1e7288db7
commit
acf4c1dece
@ -91,6 +91,23 @@ query {
|
||||
}
|
||||
```
|
||||
|
||||
### Fetch dynamic zone data
|
||||
|
||||
Dynamic zones are union types in graphql so you need to use fragments to query the fields.
|
||||
|
||||
```
|
||||
query {
|
||||
restaurants {
|
||||
dz {
|
||||
__typename
|
||||
... on ComponentDefaultClosingperiod {
|
||||
label
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Create a new entry
|
||||
|
||||
- `input`: Object
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user