Ahmed
09/30/2020, 5:27 PMPetr Homoky
09/30/2020, 5:46 PMMatt
09/30/2020, 6:22 PMDaniel Mahon
09/30/2020, 7:42 PMDave
09/30/2020, 9:02 PMconst Post = objectType({
name: 'Post',
definition(t) {
<http://t.int|t.int>('id')
t.string('title')
},
})
Pani Avula
10/01/2020, 12:59 AMJustin Voitel
10/01/2020, 7:33 AMAlbert Gao
10/01/2020, 10:53 AMt.connection
previously when using nexus, so I need to write all the type definitions by myself I suppose…. or does nexus/schema supports it? seems not?Albert Gao
10/01/2020, 10:54 AMJosef Henryson
10/01/2020, 2:27 PMAlbert Gao
10/01/2020, 10:25 PMJames Homer
10/02/2020, 11:31 AMupsert
a relation field when `create`ing.Eric Reis
10/03/2020, 6:21 PMEric Reis
10/03/2020, 6:22 PMPeter
10/03/2020, 10:13 PMmikkelsl
10/04/2020, 12:35 PMMissing type Json, did you forget to import a type to the root query?
Dave
10/04/2020, 1:19 PMimport app, { server, settings } from "nexus";
app.on.start(() => {})
settings.change({
server: {
host: '<http://192.168.1.10>',
port: 4000,
path: '/',
},
})
app.assemble();
cedric
10/04/2020, 10:08 PMexport const CreateSelectionInput = inputObjectType({
name: 'CreateSelectionInput',
definition(t) {
t.string('labelVersionId', { required: true });
t.string('name', { required: false });
t.list.string('elementIds', { nullable: false });
t.string('componentIds', { list: true, required: false });
t.field('bounds', { type: GeoJsonPolygonInput, required: false });
},
});
you'll notice i'm experimenting with a few different options with elementIds
and componentIds
. this config above generates the following sdl:
input CreateSelectionInput {
bounds: GeoJsonPolygonInput
componentIds: [String]
elementIds: [String]!
labelVersionId: String!
name: String
}
you'however, i can't seem to figure out the correct configuration to get the following sdl:
input CreateSelectionInput {
bounds: GeoJsonPolygonInput
componentIds: [String!]
elementIds: [String!]
labelVersionId: String!
name: String
}
essentially, i want to have an optional list of non-nullable strings (elementIds
and componentIds
). i can't seem to find any examples of this online.Albert Gao
10/05/2020, 7:05 AMt.list.string('tagIds')
will give me a GraphQL type like tagIds: [String]
,
t.list.string('tagIds',{required:true})
results in tagIds:[String]!
how could i get a type like this: tagIds: [String!]
Peter
10/05/2020, 10:39 AMAdam
10/05/2020, 7:24 PMauth
header for the apollo playground requests?windkomo
10/06/2020, 8:38 PMUserCreateInput
but there’s only UserCreateWithoutPostsInput
. What decides whether the plain input is generated or not ?Albert Gao
10/07/2020, 4:48 AMTaras Protchenko
10/07/2020, 11:18 AMremote: Type error: Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.
remote:
remote: 19 | name: 'User',
remote: 20 | definition(t) {
remote: > 21 | t.model.id()
remote: | ^
Maybe this connected with @nexus/schema or nexus-plugin-prisma?
"nexus-plugin-prisma": "^0.19.0",
"@nexus/schema": "^0.16.0",
windkomo
10/07/2020, 1:55 PMextendType({
type: 'Mutation',
definition(t) {
t.field('sendMessage', {
type: 'Message',
was enoughAdam
10/07/2020, 7:17 PMProject
that is related to an Organization
I would like to createOneProject
by just specifying teh organization ID but it generates as requiring the whole organization
object.
//Simplified
model Organization {
id Int @id @default(autoincrement())
name String?
projects Project[]
}
model Project {
id Int @id @default(autoincrement())
organization Organization @relation(fields: [organizationId], references: [id])
organizationId Int
name String
}
I'm using the experimentalCRUD
to generate createOneProject
but it auto generates with
type Mutation {
createOneProject(data: ProjectCreateInput!): Project!
}
Where
type Project {
id: Int!
name: String!
organizationId: Int!
}
input ProjectCreateInput {
name: String!
organization: OrganizationCreateOneWithoutProjectsInput!
}
Adam
10/07/2020, 7:21 PMorganization Organization @relation(fields: [organizationId], references: [id])
from the Project
in schema.prisma
? so that I only have the organizationId
field? Or would I lose that relation?Adam
10/07/2020, 7:29 PMconnect
functionMikastark
10/08/2020, 10:18 AM@nexus/schema
. If you look at outputs.typegen
typedoc in SchemaConfig (makeSchema function param) it says "Set to true to enable and emit into default path ... The default path is node_modules/@types/nexus-typegen/index.d.ts." but if I set the value to true
instead of a path (like ___dirname +_ '/../node_modules/@types/nexus-typegen/index.d.ts'
), it generates nothing. I am doing something wrong or is it normal ?Eric Reis
10/09/2020, 12:00 AMobjectType({
name: 'User',
definition: t => {
t.id<UserId>('id')
}
})
this is interesting when youre using nominal types, which is something might be builtin to TS one day https://github.com/microsoft/TypeScript/issues/202#issuecomment-695912785