Watson Workspace will no longer be available after February 28, 2019. Learn more.

Developers

GraphQL - 500 Internal Server Error

Comments

5 comments

  • Avatar
    Miguel Estrada

    Maybe if you post the actual payload you are sending we can validate that.... but since you say it works in graphiql tool but not in code most likely the issue is the jwt that is being used in the code.

    The graphiql tool uses a jwt derived from the browser session you already have which means it is using your identity.  In code you need to get an identity as you know... it will be either that of the app, that of a user (using oauth2 flow) or an invalid one if you are not setting it.  Aside from the payload or the URL itself being malformed in code vs graphiql that identity would be a difference.

  • Avatar
    Miguel Estrada

    I see more or less the payload you are passing.... where you say <users name is input here> is not correct as it is missing the actual argument called "name".  See this payload as a reference:

    {
      people(name:"email@company.com")
      {
        items {
          id
          displayName
          email
        }
      }
    }

     

  • Avatar
    Jason
    query getProfiles {
      people(first: 10) {
        items {
          id
          displayName
          email
        }
      }
    }

    This is what I'm using. When I put <input users name here> I meant I was doing this. My fault. I realized after the fact that I put that and really meant the above. This is what works in the graphQL if I log into the browser and use the graphql tool. If I use my app it does not.

     

  • Avatar
    Miguel Estrada

    Ok.  Thanks for clarifying.  I have reproduced the issue on my end and realize that instead of sending a 500 we should be sending a 403.  Apps on their own should not have access to the people collection as they don't really associate to any one "org".  People on the other hand, based on how they are provisioned can access their "org" plus the people they are collaborating with.  We have not implemented that concept for apps at this point.

    What were you intending to do or expected to get as a result?

    If the app needs to get people then perhaps it can first assume a person's identity via oauth ?

  • Avatar
    Jason

    I'm just testing out as much of the doc as I can while I go so I can get clarification on how each piece works but the idea makes sense.

Please sign in to leave a comment.