Mutation to create a GIST - graphql

I want to create a gist using GitHub's GraphQL API. Although, I couldn't find the mutation to use.
I tried searching for a mutation in the docs but there was none matching addGist.
Is there still a way to make a POST request to create a gist using GraphQL or will I need to resort to using many GitHub's API endpoints?

Related

Hasura - Use custom headers in queries and mutations

I would like to be able to use custom headers in queries and mutations.
Basically it would be some context that all the queries and mutations should take into account.
I cannot find a way to do it. Is it even possible with the the current (v2.15.0 as of writing) version of Hasura?
Tried searching the web

How do I prevent deleted records from appearing in my AWS Amplify GraphQL results?

By default the Amplify GraphQL APIs return deleted items.
Worse, as near as I can tell there is apparently no way to filter them: Neither syncXYZTable nor listXYZTable queries accept the _deleted field as a parameter. Fortunately the generated code in the DataStore SDK filters out these items, and (somewhat confusingly) the Amplify Studio does not display them (in the Contents tab); but this only highlights the inconsistency: For example as a developer I don't see deleted items anywhere, but as a data scientist or manager using the GraphQL API, I have (it seems) no way of avoiding them.
Am I missing something. Is there really no way to filter out deleted items using the Amplify GraphQL API?
I had to filter these _deleted records in the code. Did not find a way to filter out in GraphQL Response

Use existing graphql api in my laravel project

I am testing a graphql api and I want to integrate with my system in laravel. Is there any documentation to do this? If possible to consume and send the values ​​in graphql?
Note: I wanted to do it right
The question is too generic.
First of all, I recommend to check the official site: https://graphql.org/learn/
If you are going to consume an already existing graphql, you need a graphql client library.
Check a good list of client libraries: https://graphql.org/code/#graphql-clients
Client libraries have good documentation on how to install and use them.
If you are going to create/provide your own graphql api endpoint (that is a different story), you need a graphql server library.
Server libraries: https://graphql.org/code/#php
Laravel package (a wrapper for https://github.com/webonyx/graphql-php): https://github.com/rebing/graphql-laravel
try this library https://github.com/rebing/graphql-laravel, it's simple with good documentation

Strapi.io graphQL mutation

In strapi, we're able to build the client query which is perfect. However, i can't see any documentation on mutation/update of record using graphql.
Is this a custom implementation?
The GraphQL mutations have been developed and merged: https://github.com/strapi/strapi/pull/1650. They will be published in the next release.

GraphQL Viewer for mutations

Is it a good practice to have a viewer for GraphQL mutations? Theoretically this makes sense to me as some mutation end points shouldn't be possible if you are not logged in, etc.
But when I see examples on the web, I only see implementation of GraphQL viewers for queries. For mutations, I do not see any implementation of viewers. For example, the GitHub API doesn't have a viewer on top of all their mutations.
The viewer field isn't a good practice, either for mutations or queries. It's a remnant of Facebook's legacy GraphQL platform from before it was open-sourced, which didn't allow arguments on root query fields. This meant that all of the fields needed to be moved one level down, below viewer.
The current way to do auth in GraphQL, at least in the JavaScript implementation, is by getting the user data based on something like an HTTP header and putting it on context, as mentioned here: http://graphql.org/learn/authorization/
Therefore, there is no reason to do viewer for mutations, or for queries. Most GraphQL clients don't mind, but one situation where it could make sense to have it in queries specifically is if you are using Relay 0.x, which has inherited some of Facebook's legacy GraphQL limitations. Hopefully a future version of Relay will remove this requirement.
For an additional source, read this comment from Lee Byron, one of the original creators of GraphQL.

Resources