test('graphql.graphql - invalid query', function (t) { resetAgent(done(t, 'Unknown Query')) var schema = graphql.buildSchema('type Query { hello: String }') var root = { hello () { return 'Hello world!' } } var query = '{ hello' agent.startTransaction('foo') graphql.graphql(schema, query, root).then(function (response) { agent.endTransaction() t.deepEqual(Object.keys(response), ['errors']) t.strictEqual(response.errors.length, 1, 'should have one error') t.ok(response.errors[0].message.indexOf('Syntax Error') !== -1, 'should return a sytax error') agent.flush() }) })