gempir

Untitled

Oct 2nd, 2021
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. // Query
  2. query := `
  3. query GetUser($id: String!) {
  4. user(id: $id) {
  5. ...FullUser
  6. banned
  7. youtube_id
  8. }
  9. }
  10.  
  11. fragment FullUser on User {
  12. id
  13. emote_aliases
  14. emotes {
  15. id
  16. name
  17. status
  18. visibility
  19. width
  20. height
  21. }
  22. emote_slots
  23. }
  24. `
  25. params := graphql.Params{RequestString: query, VariableValues: map[string]interface{}{"id": "60ae3e98b2ecb0150535c6b7"}}
  26. r := graphql.Do(params)
  27. if len(r.Errors) > 0 {
  28. log.Fatalf("failed to execute graphql operation, errors: %+v", r.Errors)
  29. }
  30. rJSON, _ := json.Marshal(r)
  31. log.Infof("%s \n", rJSON) // {"data":{"hello":"world"}}
Advertisement
Add Comment
Please, Sign In to add comment