Closed dnafication closed 3 years ago
Can we use attributeFields with graphql SDL? If yes, how? are there any examples.
attributeFields
To clarify my question further. How to use features of attributeFields like mapping and type transformation without using a syntax like
let trainerType = new GraphQLObjectType({ name: 'User', description: 'A user', fields: _.assign(attributeFields(models.User), { pokemon: { type: new GraphQLList(pokemonType), resolve: resolver(models.User.Pokemon) } }) });
And use following instead
const schema = gql` id: String pokemon: [Pokemon] `
No, it returns an object. For it to work with gql the template literal would have to accept that format.
gql
Thanks @mickhansen
Can we use
attributeFields
with graphql SDL? If yes, how? are there any examples.To clarify my question further. How to use features of
attributeFields
like mapping and type transformation without using a syntax likeAnd use following instead