Slide 17
Slide 17 text
GraphQL:
GraphQL is a query language
import assert from "assert";
import { parse } from "graphql/language";
import { execute } from "graphql/execution";
import { schema } from "./schema";
execute(schema, parse(`
{
article(id :"123") {
id, title, author { id, name }
}
}
`)).then(response => {
assert.deepEqual(response.data, {
article: {
id: "123", title: "graph api",
author: {
id: "u0001",
name: "quramy"
}
}
});
});