Introduce group basic federation, event new page and notifications

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-02-18 08:57:00 +01:00
parent 300ef8f245
commit 4144e9ffd0
416 changed files with 32220 additions and 16750 deletions

View File

@@ -1,9 +1,9 @@
const fetch = require('node-fetch');
const fs = require('fs');
const fetch = require("node-fetch");
const fs = require("fs");
fetch(`http://localhost:4001`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
fetch(`http://localhost:4000/api`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
variables: {},
query: `
@@ -21,18 +21,16 @@ fetch(`http://localhost:4001`, {
`,
}),
})
.then(result => result.json())
.then(result => {
.then((result) => result.json())
.then((result) => {
// here we're filtering out any type information unrelated to unions or interfaces
const filteredData = result.data.__schema.types.filter(
type => type.possibleTypes !== null,
);
const filteredData = result.data.__schema.types.filter((type) => type.possibleTypes !== null);
result.data.__schema.types = filteredData;
fs.writeFile('./fragmentTypes.json', JSON.stringify(result.data), err => {
fs.writeFile("./fragmentTypes.json", JSON.stringify(result.data), (err) => {
if (err) {
console.error('Error writing fragmentTypes file', err);
console.error("Error writing fragmentTypes file", err);
} else {
console.log('Fragment types successfully extracted!');
console.log("Fragment types successfully extracted!");
}
});
});