bkstorm
02/21/2019, 10:01 AMUpload
type supported by Apollo server? How to use it? 😄Gomah
02/22/2019, 12:20 PM...
definition(t) {
t.string("name", { required: true })
t.id("author", { required: true })
t.field("avatar", { type: 'Upload' })
}
bkstorm
02/22/2019, 2:54 PMBruce He
07/21/2019, 3:59 PMimport { inputObjectType, scalarType, objectType, asNexusMethod } from 'nexus'
import { string } from 'yup';
import { GraphQLUpload } from 'graphql-upload';
import { GraphQLDate } from "graphql-iso-date";
export const GQLDate = asNexusMethod(GraphQLDate, "date");
export const CreateEventInput = inputObjectType({
name: 'CreateEventInput',
definition(t) {
t.id('id', { required: true })
t.string('name', { required: true })
},
})
export const Upload = asNexusMethod(GraphQLUpload, "upload");
export const UploadFileInput = objectType({
name: 'UploadFileInput',
definition(t) {
t
},
})
export const arrMutationInputs = [
CreateEventInput,
UploadFileInput
]
Can any one help me why t.date or t.upload is not available? @bkstormbkstorm
07/22/2019, 3:21 AMasNexusMethod
.
t.field('field-name', {
type: 'Upload'
})
you can use this way.