@nyteshade/lattice-legacy
Version:
OO Underpinnings for ease of GraphQL Implementation
39 lines (34 loc) • 850 B
JavaScript
import { GQLBase, Properties, Schema } from '../../es6/lattice'
(`
type YabbaDabbaDo {
name: String
isFamily: Boolean
}
type Query {
theFlintstones: YabbaDabbaDo
}
`)
export class YabbaDabbaDo extends GQLBase {
/**
* An example asynchronous RESOLVERS function
*
* @method RESOLVERS
* @param {Object} ignored typically null in tests
* @return {Promise<YabbaDabbaDo>} a newly created YabbaDabbaDo object
* instance
*/
static async RESOLVERS(ignored) {
return {
async theFlintstones() {
return new YabbaDabbaDo({
name: 'The Flintstones',
isFamily: true
})
}
}
}
}
// Try to throw an error by exporting non GQLBase extended class stuff
export const someRandomCrap = true;
export const genderIdentity = 'female'
export default YabbaDabbaDo;