Mirror: The spec-compliant minimum of client-side GraphQL.
1const fs = require('fs'); 2const graphqlWeb = require('..'); 3const graphql = require('graphql'); 4 5const kitchenSink = fs.readFileSync('./kitchen_sink.graphql', { encoding: 'utf8' }); 6const document = graphql.parse(kitchenSink, { noLocation: true }); 7 8suite('parse kitchen sink query', () => { 9 benchmark('0no-co/graphql.web', () => { 10 graphqlWeb.parse(kitchenSink); 11 }); 12 13 benchmark('graphql', () => { 14 graphql.parse(kitchenSink, { noLocation: true }); 15 }); 16}); 17 18suite('print kitchen sink query', () => { 19 benchmark('0no-co/graphql.web', () => { 20 graphqlWeb.print(document); 21 }); 22 23 benchmark('graphql', () => { 24 graphql.print(document); 25 }); 26});