You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we define our types with JavaScript and I do not plan on changing this in this project since, I like writing everything in the same language. But with gql template literals we have also a way to create our types. It is not a way I really like, but since it is possible with this project and very popular to create your types this way we should definitively document this way, also because it is very easy to switch.
Instead of:
constUserType=newGraphQLObjectType({name: 'User',description: 'This represents a User',fields: ()=>({id: {type: GraphQLInt,resolve: (user)=>user.id,},}),});
you can write something similar to:
consttypeDefs=gql` type UserType { "This represents a User" id: Int }`;constresolvers={UserType: {id: (user)=>user.id}};
The text was updated successfully, but these errors were encountered:
Right now we define our types with
JavaScript
and I do not plan on changing this in this project since, I like writing everything in the same language. But withgql
template literals we have also a way to create our types. It is not a way I really like, but since it is possible with this project and very popular to create your types this way we should definitively document this way, also because it is very easy to switch.Instead of:
you can write something similar to:
The text was updated successfully, but these errors were encountered: