Statically compiled resolvers for entire queries based on a graphql-js schema. That is, for a operation document and an executable schema, the graphqless compiler will output JavaScript code that is able to execute that operation without any GraphQL runtime execution overhead such as parsing, validating, and figuring out what resolvers to invoke.
Turns this:
query SomeQuery {
anObjectRootField {
aNestedScalarField
}
}
…into this:
;(function SomeQuery(schema, rootValue) {
return {
data: {
anObjectRootField: (function () {
const result_1 = schema
.getType("Query")
.toConfig()
.fields.anObjectRootField.resolve(rootValue, {}, undefined)
if (result_1) {
return Object.assign({}, result_1, {
aNestedScalarField: schema
.getType("AnObjectRootFieldType")
.toConfig()
.fields.aNestedScalarField.resolve(result_1, {}, undefined, {}),
})
}
})(),
},
}
})