a11
(Anton Sidorov)
November 3, 2020, 1:04pm
1
Hello Prismic people!
Trying to fetch my Prismic sliced data.
Query is quite simple:
query MyQuery {
allPrismicArticles(filter: {uid: {eq: "article-1"}}) {
edges {
node {
data {
body {
... on PrismicArticlesBodyText {
id
primary {
text {
html
text
raw
}}}}}}}}}
But somehow explorer returns me just this:
{
"data": {
"allPrismicArticles": {
"edges": []
}
},
"extensions": {}
}
You can see it here:
What am I doing wrong?
If I made query like this (without slices):
query MyQuery {
allPrismicArticle {
edges {
node {
data {
body {
primary {
text {
text
}
}
}
}
}
}
}
}
... correct data will return:
1 Like
Hello! Could you share your repository URL?
a11
(Anton Sidorov)
November 3, 2020, 3:22pm
3
1 Like
a11
(Anton Sidorov)
November 4, 2020, 12:24pm
4
Sorry, didn't commit last changes with slices.
Now it's done, you can see.
1 Like
Great news! That was confusing me
1 Like
a11
(Anton Sidorov)
November 6, 2020, 11:47am
6
Guys any ideas?
Maybe someone solved same problem before?
Hey @a11 ,
Thanks for posting this question! I notice that your first GraphQL query (the one that doesn't work) begins:
allPrismicArticles(filter: {uid: {eq: "article-1"}}) {
Your second query (the one that works) begins:
allPrismicArticle {
The first has an s
and the second does not. I downloaded your repo and recreated everything, and if I use allPrismicArticle
, without the s
, it works perfectly for me.
I hope I understood your issue properly. Please let me know if this solves the issue! If not, let me know, and I'll keep digging
Best,
Sam
samlittlefair
(Sam Littlefair)
closed , flag & select 'Something Else' to reopen.
December 7, 2020, 9:09am
9
This issue has been closed due to inactivity. Flag to reopen .