Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add graphql support #75

Closed
Revadike opened this issue Feb 29, 2020 · 1 comment · Fixed by #77
Closed

Add graphql support #75

Revadike opened this issue Feb 29, 2020 · 1 comment · Fixed by #77
Labels
enhancement New feature or request

Comments

@Revadike
Copy link
Contributor

Functionality, like redeeming product codes, rely on graphql queries and mutations. It would be nice to see some kind of abstraction for graphql requests. I could PM you some examples.

@SzymonLisowiec
Copy link
Owner

I don't have free time to add it, but you can use below code:

const { GraphQLClient } = require('graphql-request');

// client - instance of epicgames-client

const ql = new GraphQLClient('https://graphql.epicgames.com/graphql', {
  headers: {
    Authorization: `${client.account.auth.tokenType} ${client.account.auth.accessToken}`,
    Origin: 'https://epicgames.com',
    Cookie: `EPIC_BEARER_TOKEN=${client.account.auth.accessToken}`,
    Referer: 'https://www.epicgames.com,
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',
    'X-Requested-With': 'XMLHttpRequest',
    'X-XSRF-TOKEN': 'XSRF TOKEN FROM EG. HOMEPAGE EPICGAMES.COM',
  },
});

I used it a long time ago, so something may need improvement

@SzymonLisowiec SzymonLisowiec added the enhancement New feature or request label Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants