Github GraphQL v4 truncating text Field of large Blob

I’m trying to download a file from Github using the GraphQL API v4. The file is a few megabytes in size. Currently the API appears to truncate the returned text field for the Blob, but still returns some text and the other field (byteSize) successfully.

The API version 3 documents the size restriction of certain API request, but the V4 does not appear to this.

Is there a size limit for text in Blobs for the GraphQL API? If so what is it?

Also if anyone can suggest an API driven method for retriving a Blob, additional thanks.

A demostration Python program which displays this behaviour can be found here: https://github.com/Clockray/repository1/blob/master/publicquerydemo.py

I’ve created a target file: https://github.com/Clockray/repository1/blob/master/bigfile.txt which is slightly too big for the API to handle.

Blob object reference:https://developer.github.com/v4/object/blob/

API v3 request size limit reference https://developer.github.com/v3/repos/contents/

4 Likes

I can confirm - same problem for retrieving gists with text over 1 MB.
This query

const getGist = () => `
  query ($name: String!) {
    viewer {
      gist(name: $name) {
        files {
          size
          text
        }
      }
    }
  }
`;

Truncates the text field. The regular API does not.

console.log(content.size, content.text.length);  // 1187172,  921600