Getting content of multiple files using graph QL

I’m trying to obtain the contents of multiple files from a specific commit using GraphQL. This is my schema:

query {
    repository(owner:$OWNER, name: $REPO_NAME) {
        folder: object(expression: $OID:$filename1)
            { . ... on Blob {
                      text
             } },
            object(expression: $OID:$filename1)
            { . ... on Blob {
                      text
             } },
            object(expression: $OID:$filename1)
            { . ... on Blob {
                      text
             } }
} }

This schema works fine when I get two files from the commit. But, when I add another specific file I get an error that  

Field 'folder' has an argument conflict

on the last two files. 

However, when I get only one file for any file, I am able to retrieve it just fine. I’m very confused as to why this is happening.

It took a bit for me to figure out exactly what the problem was because the syntax you supplied was broken in a couple areas. Here’s what I got to work:

{
  repository(owner: "atom", name: "atom") {
    first: object(expression: "9793c74835db6997e15a71dae0cca83bf2b7d159:src/atom-environment.js") {
      ... on Blob {
        text
      }
    }
    second: object(expression: "9793c74835db6997e15a71dae0cca83bf2b7d159:src/crash-reporter-start.js") {
      ... on Blob {
        text
      }
    }
    third: object(expression: "9793c74835db6997e15a71dae0cca83bf2b7d159:src/get-release-channel.js") {
      ... on Blob {
        text
      }
    }
    fourth: object(expression: "9793c74835db6997e15a71dae0cca83bf2b7d159:src/main-process/start.js") {
      ... on Blob {
        text
      }
    }
  }
}

First, because you are trying to query the same connection multiple times with different parameters, you’ll need to use aliases. This is what the first, second, third, and fourth are about in my version of your query.

Second, it appears that you were trying to create a single value out of multiple variables in your query with $OID:$filename1. Currently, GraphQL doesn’t support string interpolation, so you’ll have to create the variable in whatever language you’re using to craft the query in and supply the entire expression for each object as a single string.

I hope that helps!