How to create a file use GraphQL API v4 in specific branch?

I want use GraphQL APi to create A file in a specific branch.

I find CREATE A FILE BY RESTAPI v3 , but i didn’t find same api in GraphQL?

and, if i set a new branch which not ‘maser’ ,is this branch inherit from master or a orphan branch ?


Hi @bestony,

Thanks for being here! There is currently no way to create a repository using v4 API. The good news is that we have a focused team working on building out parity between REST and GraphQL. It’s hard to give ETAs on these mutations for you, but they’re on the list of things to do!

I hope this helps!

Any news regarding this issue?

There isn’t any new information on this at this time. We do try to come back to forum discussions involving feature requests if/when those features or updates have been implemented to let the community know. You can also watch the changelog for the most up to date info on what we’re working on:

I think @andreagriffiths11 misunderstood the question. I think the question was asking, how to create a file using the GraphQL api, not create a repository.

Has file creation via the GraphQL api been delivered yet? I also require this feature.

Thanks for the ping @jknapp25, I appreciate the clarification, unfortunately the answer is the sameish :thinking:
Currently, we do not expose an equivalent of the repository contents API under the GraphQL API. However, you can access the object repository connection not the same.

Would you mind sharing an example of how to use object for creating a file? @andreagriffiths11