Mp3 file in a document

Hey,
I’m trying to add an mp3 file to a document. After my build I see the field in GraphQL but not the file, i’m getting null in FileLink.

Any thoughts?

Could you share your graphql query?

I’ve tried it and mp3 files work with graphql for me.

{
“data”: {
“prismic”: {
“allResource_details”: {
“edges”: [
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
},
{
“node”: {
“mp3_link”: null
}
}
]
}
}
}
}

Could you send the query, rather than the response?

Something like:

query {
  prismic {
    allResource_details {
      edges {
        node {
          mp3_link
        }
      }
    }
  }
}

{
prismic {
allResource_details {
edges {
node {
mp3_link {
_linkType
… on PRISMIC__FileLink {
_linkType
name
url
}
}
}
}
}
}
}

Couple things to check - is the document actually published?
image

Should there be capitals on the line ...on PRISMIC__FileLink?

Yes the document is published.
I just copied the line from graphQL and it worked with other queries.

Could you share your repository URL?

https://github.com/withloveinternet/jenzabar/tree/staging/src/components/resource

I think that’s private, I get a 404. The URL I’m after is your prismic one, like https://something.prismic.io.

Sorry.
https://jenzabar.prismic.io/masks/resource_detail.json/ - custom type.
https://jenzabar.prismic.io/documents~b=working&c=published&l=en-us/XmfZ7xUAACQA2y7P/ - the document i’m trying to put the mp3 in.

Found it!, it only appears with a uid filter to the specific document that uses the file, when there is no filter all is null, do you have an idea why?

{
prismic {
allResource_details(uid: “webinar-audits-reporting-compliance”) {
edges {
node {
mp3_link {
… on PRISMIC__FileLink {
url
}
}
}
}
}
}
}

Great, glad you’ve solved it!

I’m afraid I don’t know why it does that, but it sounds like a bug. I couldn’t find anything in the docs that explain that behaviour. @paulina.gavilan, any ideas?

Hello Netanel, you’re not seeing the next documents that do have items on that field because the Prismic GraphQL API returns a maximum of 20 documents per request. There is no way to increase this number, so this page explains how you can retrieve more than this initial 20 documents.

This issue has been closed due to inactivity.