fetch('http://127.0.0.1:4000/graphql', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', }, body: JSON.stringify({query: "{ name subjects }"})}).then(r => r.json()) .then(data => console.log('data returned:', data));