Be well coding/Learn more
Apollo Token
be well
2019. 7. 26. 15:14
import React from 'react';
import { render } from 'react-dom';
import './index.css';
import App from './App';
import ApolloClient from "apollo-boost";
const client = new ApolloClient({
uri: "https://api.github.com/graphql",
request: operation => {
operation.setContext({
headers: {
authorization: `Bearer your-personal-access-token`
},
});
}
});
render(<App />, document.getElementById('root'));
uri : 데이터를 가져 오기 위해 사용하는 graphql 끝점.
요청 : 모든 요청에 대해 현재 사용자를 확인하기 위해 승인 헤더를 보낸다.