gempir icon

Untitled

gempir | PRO | 10/02/21 06:43:02 PM UTC | 0 ⭐ | 518 👁️ | Never ⏰ | []
text |

620 B

|

None

|

0 👍

/

0 👎

// Query
	query := `
	query GetUser($id: String!) {
		user(id: $id) {
		  ...FullUser
		  banned
		  youtube_id
		}
	  }
 	fragment FullUser on User {
		id
		emote_aliases
		emotes {
			id
			name
			status
			visibility
			width
			height
		}
		emote_slots
	}
	`
	params := graphql.Params{RequestString: query, VariableValues: map[string]interface{}{"id": "60ae3e98b2ecb0150535c6b7"}}
	r := graphql.Do(params)
	if len(r.Errors) > 0 {
		log.Fatalf("failed to execute graphql operation, errors: %+v", r.Errors)
	}
	rJSON, _ := json.Marshal(r)
	log.Infof("%s \n", rJSON) // {"data":{"hello":"world"}}

Comments