var {
graphql,
GraphQLSchema: Schema,
GraphQLObjectType: ObjectT,
GraphQLString: StringT,
GraphQLScalarType: ScalarT,
} = require('graphql');
require('babel-runtime/core-js/object/values');
require('graphql-tools');
var { mergeTypes } = require('merge-graphql-schemas');
var Query = new ObjectT({
name: 'query',
fields: () => ({
get: {
type: StringT,
resolve() {
return 'sometihng getted';
},
},
scal: {
type: new ScalarT({
name: 'scalarius',
serialize: (value) => value,
}),
resolve() {
return [{
a: 1,
b: 2,
}, {
c: 3,
}]
},
}
}),
});
var schema = new Schema({
query: Query,
});
graphql(schema, `{ get, scal }`).then((result) => { console.log(result); });