picosam
04/21/2018, 12:14 PMnilan
04/21/2018, 1:12 PMpicosam
04/21/2018, 1:15 PMnilan
04/21/2018, 1:15 PMpicosam
04/21/2018, 1:16 PMtype Mutation {
signUp(idToken: String!): User
verifyEmail(idToken: String!): User @isAuthenticated(checkIfEmailIsVerified: false)
deleteMe: User @isAuthenticated
createEvent(data: EventCreateInput!): Event! @hasRole(roles: ["ADMIN, ORGANIZER"])
attendEvent(id: ID!, code: String): Event! @isAuthenticated
}
picosam
04/21/2018, 1:16 PMcreateEvent
entirelypicosam
04/21/2018, 1:16 PMpicosam
04/21/2018, 1:16 PMnilan
04/21/2018, 1:17 PMpicosam
04/21/2018, 1:17 PMType "Node" is missing a "resolveType" resolver. Pass false into "resolverValidationOptions.requireResolversForResolveType" to disable this warning.
picosam
04/21/2018, 1:17 PMnilan
04/21/2018, 1:17 PMpicosam
04/21/2018, 1:19 PMpicosam
04/21/2018, 1:19 PMnilan
04/21/2018, 1:21 PMposts: Post
resolver. I also receive no error. But when I send a posts
query, I immediately get the result null
. No additional query is sent anywhere.nilan
04/21/2018, 1:23 PMcreatePost(data: PostCreateInput!): Post!
. When I execute it, I get thispicosam
04/21/2018, 1:24 PM@hasRole(roles: ["ADMIN, ORGANIZER"])
part (which throws an error at the directive resolver level, it still goes through, but gives the following error:nilan
04/21/2018, 1:24 PM{
"data": null,
"errors": [
{
"message": "Cannot return null for non-nullable field Mutation.createPost.",
"locations": [
{
"line": 14,
"column": 3
}
],
"path": [
"createPost"
]
}
]
}
picosam
04/21/2018, 1:24 PMnilan
04/21/2018, 1:24 PMnull
picosam
04/21/2018, 1:25 PMforwardTo
in this case, right?nilan
04/21/2018, 1:25 PMnilan
04/21/2018, 1:26 PMpicosam
04/21/2018, 1:26 PMnilan
04/21/2018, 1:26 PMcreatePost(parent, { isPublished, title, text }, context: Context, info) {
return context.db.mutation.createPost(
{ data: { isPublished, title, text } },
info,
)
},
(TypeScript)nilan
04/21/2018, 1:27 PMnilan
04/21/2018, 1:28 PMpicosam
04/21/2018, 1:28 PMnilan
04/21/2018, 1:30 PMnilan
04/21/2018, 1:38 PM