oliyh / re-graph

A graphql client for clojurescript and clojure
461 stars 40 forks source link

Custom payload for queries, mutations and subscriptions #70

Open sebastibe opened 4 years ago

sebastibe commented 4 years ago

Some GraphQL servers requires to pass other keys to the payload than query and variables.

For example, this is the subscription query in AWS AppSync:

{
    'id': SUB_ID,
    'payload': {
        'data': GQL_SUBSCRIPTION,
        'extensions': {
            'authorization': {
                'host':HOST,
                'x-api-key':API_KEY
            }
        }
    },
    'type': 'start'
}

Here is the doc.

It doesn't seem possible at the current stage but maybe exposing a lower level event taking a payload map could do the trick in the future?

For information, AppSync also don't support other methods than subscriptions through Websockets as mentioned in #65 .