Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put duration in better place in graphQL #43

Closed
logemann opened this issue Sep 3, 2021 · 1 comment
Closed

put duration in better place in graphQL #43

logemann opened this issue Sep 3, 2021 · 1 comment
Labels

Comments

@logemann
Copy link

logemann commented Sep 3, 2021

When querying my video content with graphql (gatsby) with the following query:

  allSanityVideos {
    edges {
      node {
        video {
          asset {
            playbackId
            thumbTime
            assetId
            status
          }
          _rawAsset(resolveReferences: {maxDepth: 2})
        }
        _id
      }
    }
  }

I am getting the duration only via _rawAsset and not via video -> asset structure. See the result below

{
  "data": {
    "allSanityVideos": {
      "edges": [
        {
          "node": {
            "video": null,
            "_id": "drafts.d970338c-1ebb-4f88-b9b4-cec9615c7e63"
          }
        },
        {
          "node": {
            "video": {
              "asset": {
                "playbackId": "cxsHvFHCpnedi02nL8kNrmvzzHYuSx84LyoA4Nh00Lv6s",
                "thumbTime": null,
                "assetId": "BSt8QSrjyqUhrEGLnMKBNqGrq8wfBmhwwZH8LyRe74A",
                "status": "ready"
              },
              "_rawAsset": {
                "_id": "296f5350-2cf9-40ea-9264-733f3af3ba7d",
                "_type": "mux.videoAsset",
                "_rev": "cWhOHnBK4b0ef4hteFMZbG",
                "_createdAt": "2021-09-03T01:09:50Z",
                "_updatedAt": "2021-09-03T01:09:57Z",
                "assetId": "BSt8QSrjyqUhrEGLnMKBNqGrq8wfBmhwwZH8LyRe74A",
                "data": {
                  "aspect_ratio": "16:9",
                  "created_at": "1630631394",
                  "duration": 1.368033,
                  "id": "BSt8QSrjyqUhrEGLnMKBNqGrq8wfBmhwwZH8LyRe74A",
                  "master_access": "none",
                  "max_stored_frame_rate": 29.97,
                  "max_stored_resolution": "SD",
                  "mp4_support": "none",
                  "passthrough": "296f5350-2cf9-40ea-9264-733f3af3ba7d",
                  "playback_ids": [
                    {
                      "id": "cxsHvFHCpnedi02nL8kNrmvzzHYuSx84LyoA4Nh00Lv6s",
                      "policy": "public"
                    }
                  ],
                  "status": "ready",
                  "tracks": [
                    {
                      "duration": 1.368033,
                      "id": "I3vSAu00fdHFlQG02eUSJcX5PZPr6UjhslSD01337pAXFk",
                      "max_frame_rate": 29.97,
                      "max_height": 540,
                      "max_width": 960,
                      "type": "video"
                    }
                  ],
                  "upload_id": "qOpRpZwWIaWniLFIolTiOL5kduC65GPjGLth8xdrPA00"
                },
                "playbackId": "cxsHvFHCpnedi02nL8kNrmvzzHYuSx84LyoA4Nh00Lv6s",
                "status": "ready",
                "uploadId": "qOpRpZwWIaWniLFIolTiOL5kduC65GPjGLth8xdrPA00",
                "id": "-51e61cef-8d54-5622-821d-20e7758f6d6a",
                "children": [],
                "internal": {
                  "type": "SanityMuxVideoAsset",
                  "contentDigest": "bd28bb324a2e85b9d376e57a4220a842",
                  "owner": "gatsby-source-sanity",
                  "counter": 651
                },
                "parent": null
              }
            },
            "_id": "027b7daa-58b1-479c-840e-40baa23f771c"
          }
        },
]}}}

I simply cant find the codeblock who is responsible for putting the clip duration which is burried under _rawAsset.data into the perfect slot right beneath playbackId and thumbTime.

@hdoro
Copy link
Collaborator

hdoro commented May 20, 2024

Fixed as of the upcoming 2.4.0 release:

screenshot of the GraphQL playground

Sorry for the 3-year wait and thank you for reporting, Marc!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants