Luke
07/21/2019, 1:22 AMtype User {
id: ID! @unique @id
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
in my schema but those fields are not being auto generated. When I create a new user they are empty. Do I need to explicitly set them? or can Prisma do that for me?Sushmitha M Katti
07/21/2019, 9:54 AMAnton
07/21/2019, 12:38 PMBruce He
07/21/2019, 4:02 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 to to fiure out why scala types not find in my project event I have defined them. t.date or t.upload both not workingDaniel Moos
07/22/2019, 7:40 AMDaniel Moos
07/22/2019, 7:40 AMTaras Protchenko
07/22/2019, 1:23 PMCameron
07/22/2019, 1:59 PMtype User {
id: UUID! @unique
someField: TypeTwo @relation(name: "RelationName", onDelete: CASCADE)
}
type TypeTwo {
id: UUID! @unique
user: User! @relation(name: "RelationName")
}
My schema.graphql is:
type User {
id: UUID!
someField: TypeTwo
}
type TypeTwo {
id: UUID!
user: User!
}
I have a query to get user information inside my Query resolvers:
me: (parent, args, context) => {
return context.prisma.user({ id: args.id })
}
The weird thing is when I run the query on the graphql playground it returns the someField value for User, but when I console.log the query on my express server, it shows every field for User except for someField. Data is being saved correctly inside my db (Postgres). The playgrounds for my server and client are consistent. I have another relation field on User as well, and I have the same issue. Does anyone know why this would be? I can provide more information if helpful. I’m using prisma 1.34.1 and graphql-yoga 1.17.0.Osicka
07/22/2019, 2:54 PMthecrazyhoodie
07/22/2019, 3:50 PMthecrazyhoodie
07/22/2019, 3:50 PMthecrazyhoodie
07/22/2019, 3:50 PMmacejmic
07/22/2019, 4:58 PMroomsConnection
, query looks like this:
query{
roomsConnection(where:{location:{id:"cjy5v86kx00ds0736x73fr63a"}}){
edges{
node{
name
}
}
pageInfo{
endCursor
startCursor
hasNextPage
hasPreviousPage
}
}
}
this works just fine, but i need to re-do the generated query and change it for a bit:
export const roomsConnection = queryField('roomsConnection', {
type: 'RoomConnection',
async resolve(_parent, args:any, { prisma }) {
const newReturn = {
pageInfo: prisma.roomsConnection(args).pageInfo(),
edges: prisma.roomsConnection(args).edges(),
aggregate: prisma.roomsConnection(args).aggregate()
}
return newReturn
}
});
the only thing that is missing is args
, all where
, skip
etc. arguments should be defined.. i’m trying re-use generated args with something like this:
import { NexusGenArgTypes } from '../../generated/nexus';
const reusedArgs: NexusGenArgTypes["Query"]["roomsConnection"] = {};
and then use it within the custom resolver as:
args: reusedArgs
but it does not work.. anybody has an idea what to do? thanks a lot!thecrazyhoodie
07/22/2019, 6:46 PMthecrazyhoodie
07/22/2019, 6:47 PMAndrés Villalobos
07/22/2019, 6:50 PMKrispin Leydon
07/22/2019, 8:12 PMKrispin Leydon
07/22/2019, 8:12 PMyuritoledo
07/22/2019, 10:46 PMKenan Pulak
07/23/2019, 12:34 AMIgor Vuleta
07/23/2019, 7:35 AMPaul Hachmang
07/23/2019, 7:40 AMkoufatzis
07/23/2019, 7:56 AMswangy
07/23/2019, 10:40 AMswangy
07/23/2019, 10:41 AMKrispin Leydon
07/23/2019, 6:13 PMkoia
07/23/2019, 6:16 PMnpm view prisma
prisma@1.30.5 | Apache-2.0 | deps: 5 | versions: 694
Prisma is a realtime GraphQL database layer. Connect directly from the frontend or build your own GraphQL server.
<https://github.com/prisma/prisma>
keywords: prisma, graphql, backend, deployment, api, server
bin: prisma
dist
.tarball: <https://registry.npmjs.org/prisma/-/prisma-1.30.5.tgz>
.shasum: 3c01c984b31540f3b8c8495aeadb06dabe4ecc6b
.integrity: sha512-tZ1tFqF8nja8pUAhfvkFpo4z1Oee8vo1n5Ip3S3BqRiocaau6h9LY+xoSwHTHmmCmu7/Yv0reNyE5B6gkZ1W1g==
.unpackedSize: 27.3 kB
dependencies:
fs-extra: ^7.0.0 prisma-cli-engine: 1.30.5 source-map-support: ^0.4.18
prisma-cli-core: 1.30.5 semver: ^5.4.1
maintainers:
- schickling <schickling.j@gmail.com>
- timsuchanek <tim.suchanek@gmail.com>
dist-tags:
alpha: 1.36.0-alpha.11 changelog: 1.9.0-changelog.1 test: 1.24.0-test.5
beta: 1.35.0-beta latest: 1.30.5
koia
07/23/2019, 6:17 PMkoia
07/23/2019, 6:23 PM~ → npm info prisma versions | grep 1.34
'1.33.0', '1.34.0-alpha.1', '1.34.0-alpha.2',
'1.34.0-beta', '1.34.0-beta.1', '1.34.0',
'1.34.1', '1.34.2', '1.35.0-alpha.1',
But why is it pulling the 1.30.5 version as the latest? @tim2koia
07/23/2019, 6:34 PM