Rodrigo
05/30/2020, 4:59 PMpublic
. This is how my docker-compose file looks like:
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.34
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
# managementApiSecret: my-secret
databases:
default:
connector: postgres
host: <http://ec2-3-222-30-53.compute-1.amazonaws.com|ec2-3-222-30-53.compute-1.amazonaws.com>
database: ....
schema: public
user: ....
password: .....
ssl: true
rawAccess: true
port: '5432'
migrations: true
Rodrigo
05/30/2020, 5:00 PMendpoint: <http://localhost:4466/reviews/default>
datamodel: datamodel.graphql
The idea is to create a new schema reviews$default
and create tables thereRodrigo
05/30/2020, 5:01 PMdatamodel.graphql
file:
type User {
id: ID! @id
name: String!
createdAt: DateTime! @createdAt
updatedAt: DateTime! @updatedAt
}
If I try to create a new user I get this error:
"errors": [
{
"message": "Whoops. Looks like an internal server error. Search your server logs for request ID: local:ckatvww0900030724wfxfehnw",
"path": [
"createUser"
],
"locations": [
{
"line": 2,
"column": 3
}
],
"requestId": "local:ckatvww0900030724wfxfehnw"
}
]
Vignesh
05/30/2020, 5:27 PMRodrigo
05/30/2020, 5:27 PMVignesh
05/30/2020, 5:28 PMVignesh
05/30/2020, 5:28 PMRodrigo
05/30/2020, 5:28 PMRodrigo
05/30/2020, 5:28 PMRodrigo
05/30/2020, 5:29 PMRodrigo
05/30/2020, 5:29 PMRodrigo
05/30/2020, 5:31 PMpublic
schemaTroy
05/30/2020, 9:51 PMzth
05/31/2020, 10:14 AM@id
is autoincremented, per model? I'd like to increment them at different intervals in Postgres for different types (example; Post
id:s incremented like 1, 1001, 2001, 3001, 4001, 5001
, Author
incremented at 2, 2002, 3002, 4002
, so starting at a different 1st number and then incrementing by 1000)Jeanre Swanepoel
05/31/2020, 4:57 PMJeanre Swanepoel
05/31/2020, 5:00 PMtype Company {
id: ID! @id
name: String! @unique
users: [User]
}
type User {
id: ID! @id
email: String! @unique
password: String!
firstNames: String!
lastName: String!
nickName: String!
mobileNumber: String!
member: Boolean! @default(value: false)
leader: Boolean! @default(value: false)
company: Company!
}
Jeanre Swanepoel
05/31/2020, 5:01 PMconst company = await context.prisma.company({ id: token['companyId'] });
const user = await context.prisma.createUser({ ...args, password, company })
I get the following
"message": "Variable '$data' expected value of type 'UserCreateInput!' but got: {\"email\":\"<mailto:bob@prisma.io|bob@prisma.io>\",\"password\":\"$2a$10$0SP1mouEQbdyXFHtkBl91.NwoWc6waUFIjZh2NlLzQwpRaQzZmfXm\",\"firstNames\":\"Bob\",\"lastName\":\"Prisma\",\"mobileNumber\":\"0721222323\",\"nickName\":\"Bobby\",\"member\":false,\"leader\":true,\"company\":{\"id\":\"ckav9lduzothk0941ha2qlr5v\",\"name\":\"Fluenty\"}}. Reason: 'company.id' Field 'id' is not defined in the input type 'CompanyCreateOneWithoutUsersInput'. (line 1, column 11):\nmutation ($data: UserCreateInput!) {\n ^",
Jeanre Swanepoel
05/31/2020, 5:01 PMJeanre Swanepoel
05/31/2020, 5:02 PMJeanre Swanepoel
05/31/2020, 5:04 PMTroy
05/31/2020, 6:50 PMDuplicate "graphql" modules cannot be used at the same time since different versions may have different capabilities and behavior.
I have tried following the steps here:
yarn cache clean
yarn upgrade-interactive --latest
rm -rf node_modules
npm install
yarn run dev
as well as added the following to package.json
:
"resolutions": {
"graphql": "^15.0.0"
},
but still get the following:
Error: Cannot use GraphQLNonNull "[Item]!" from another module or realm.
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.
<https://yarnpkg.com/en/docs/selective-version-resolutions>
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
Philipp Rajah Moura Srivastava
06/01/2020, 3:11 PMJérémie Chazelle
06/01/2020, 3:19 PMMoray Macdonald
06/01/2020, 3:31 PMMoray Macdonald
06/01/2020, 3:32 PMStuart Faircloth
06/01/2020, 5:03 PMMathieu
06/02/2020, 9:01 AMnpx prisma migrate up --experimental
on the release phase of the Procfile but npx spits out a migrate up is not a prisma command.
. Whats the correct workflow? are you supposed to migrate the db manually before deploying to heroku? or am i doing something wrong in my Procfile/heroku deployment process.James Fox
06/02/2020, 3:55 PMmodel Vote {
id String @id
type [ThingA | ThingB] // A vote must be exactly one of these 2
created_at DateTime @default(now())
updated_at DateTime @updatedAt
}
Luís Almeida
06/02/2020, 3:56 PMMike SOK
06/02/2020, 4:13 PM