g
08/06/2020, 7:09 PMg
08/06/2020, 7:09 PMMeiri Anto
08/06/2020, 7:55 PMMunkhtegsh Munkhbat
08/08/2020, 6:45 AMjanpio
Daniel Esteves
08/14/2020, 1:27 AMDaniel Esteves
08/14/2020, 1:27 AMDaniel Esteves
08/14/2020, 1:28 AMcurrency
is an enum type, how can i declare that in the query?Michael Gardner
08/18/2020, 9:50 PMjwt-auth
, prisma
, shield
) involving the experimental feature crud
where I have a general check for authenticated user:
const isAuthenticated = rule({ cache: 'contextual' })(async (parent, args, ctx: NexusContext, info) => {
const userID = getUserID(ctx.token);
return Boolean(userID);
});
for all my queries and mutations. Now it works for my custom ones, like
t.field('me', {
type: 'User',
resolve: async (_parent, _args, context) => {
const userID = getUserID(context.token);
const { db } = context;
return await db.user.findOne({ where: { id: userID } });
},
});
but when i use any query or mutation from t.curd
the token in the authorization
header does not get grabbed by the libraries to be parsed into the token
key in the context
resulting in a null
value instead of a json object of the payload. currently using
{
"nexus": "^0.26.1",
"nexus-plugin-jwt-auth": "^1.0.0",
"nexus-plugin-prisma": "^0.17.0",
"nexus-plugin-shield": "^0.2.0",
}
Alex Vilchis
08/19/2020, 3:09 PMMeiri Anto
08/19/2020, 6:47 PMError: Could not find input type name: Json
with nexus-prisma
. Seems like it's not recognizing a JSON input when the mutation is defined with t.crud
? It works fine when I use a custom mutation resolver to create the object instead of t.crud.createOneX
sylflo
08/23/2020, 11:31 AMquery rate {
seasonRates {
id
title
year
week
night
weekend
minimumDuration
color
seasons {
id
date
start # boolean
end # boolean
rate {
id
color
title
}
}
}
}
Is it possible to filter the seasons type and only get the ones which have start or end as true ?Ian Wensink
08/24/2020, 10:01 AMBernd Münzer
08/25/2020, 3:05 PMmikkelsl
08/25/2020, 4:28 PMt.model.email({
resolve: ({ email }) => {
if (!email.includes('@')) {
throw new UserInputError('Invalid email')
}
return email
},
})
Alan
08/25/2020, 9:24 PM"GraphQLError: Variable "$authDevice" got invalid value "2020-08-25T21:15:27.337Z" at "authDevice.timeOpened"; Expected type "DateTime"."
"2020-08-25T211527.337Z" is not considered as a DateTime
for Nexus? (https://github.com/graphql-nexus/schema/issues/493)sven
08/27/2020, 9:50 AMfunction createIsomorphLink() {
if (typeof window === 'undefined') {
// const { SchemaLink } = require('@apollo/client/link/schema');
// const { schema } = require('./schema');
// return new SchemaLink({ schema });
} else {
const { HttpLink } = require('@apollo/client/link/http');
return new HttpLink({
uri: `${process.env.NEXT_PUBLIC_API_BASE}/api/graphql`,
credentials: 'same-origin',
});
}
}
The commented part is what comes from the example. How would I connect it with nexus?Alan
08/27/2020, 3:01 PMAlbert Gao
08/30/2020, 7:05 AMresolve
function? In my case, I just want to convert the id
property of the target entity to a ID
type, is my usage correct?Pieter
08/30/2020, 12:49 PMAlbert Gao
09/01/2020, 8:41 AMnexus
is generating different TS types compare to what Prisma type is expecting?In this picture, the description
in CreateCompanyInput
, is string|null|undefined
while, the type needed from db.company.create()
for description
is string|undefined
for the actual field description: String?
in the schema. What am I missing here?Albert Gao
09/01/2020, 10:07 PMnexus-plugin-prisma
be updated? the 0.17 still uses Prisma 2.4, and Prisma just released 2.6 today… 😄 @jasonkuhrt @weakkyPieter
09/02/2020, 4:16 PMBernd Münzer
09/03/2020, 8:48 AMspinx
09/04/2020, 10:31 AMExpected Iterable, but did not find one for field
error and getting nowhere 😕 Would appreciate a steer in the right direction.spinx
09/04/2020, 10:35 AMExpected Iterable, but did not find one for field setupAccountPayload.errors
Albert Gao
09/04/2020, 11:06 AMnexus-prisma-plugin
? I set the prisma plugin up with paginationStrategy: 'relay',
, but still, the list returns from a list t.model.tasks({ alias: 'taskConnection' })
is not EdgeType
but the entity directly(the arguments are correct though 😄 ) , and relay complains about it . How could I get the Relay style connection been generated for me?blitz2145
09/04/2020, 10:34 PMAlbert Gao
09/06/2020, 12:16 PMschema.connections
actually do? I set it up, but nothing happens to my GraphQL root or context object? https://nexusjs.org/api/nexus/settings#schemaconnectionsAlbert Gao
09/07/2020, 12:16 AMnode
in GraphQL with Nexus https://www.albertgao.xyz/2020/09/07/how-to-implement-relay-node-in-graphql/