romshark / dgraph_graphql_go

A GraphQL + Dgraph + Go + HTTP based backend service demo.
MIT License
50 stars 15 forks source link

Authorization error in mutations: createPost & createReaction #27

Closed DanielSharkov closed 5 years ago

DanielSharkov commented 5 years ago

"Unauthorized" response on createPost() and createReaction()

Request:

mutation (
    $author: Identifier!
    $postTitle: String!
    $postContents: String!
    $reactSubject: Identifier!
    $reactEmotion: Emotion!
    $reactMessage: String!
) {
    createPost(
        author: $author
        title: $postTitle
        contents: $postContents
    ) {
        id
        title
        contents
        creation
    }
    createReaction(
        author: $author
        subject: $reactSubject
        emotion: $reactEmotion
        message: $reactMessage
    ) {
        id
        creation
        emotion
        message
    }
}

Headers:

{
    "Authorization": "Bearer <session key>"
}
DanielSharkov commented 5 years ago

My bad. I've passed the wrong author argument. Actually, it works just fine.