Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { stringArg } from 'nexus'
import { prismaObjectType } from 'nexus-prisma'
export const Query = prismaObjectType({
name: 'Query',
definition(t) {
/**
* - use `t.prismaFields(['*'])` to expose all the underlying object type fields
* - use `t.primaFields(['fieldName', ...])` to pick and/or customize specific fields
* - use `t.prismaFields({ filter: ['fieldName', ...] })` to filter and/or customize specific fields
*/
// An empty array removes all fields from the underlying object type
t.prismaFields([])
t.list.field('feed', {
type: 'Post',
resolve: (parent, args, ctx) => {
return ctx.prisma.posts({
where: { published: true },
import { prisma } from "../../database/generated/client";
import datamodelInfo from "../../database/generated/nexus-prisma";
import { prismaObjectType, makePrismaSchema } from "nexus-prisma";
const path = require("path");
// @ts-ignore
const User = prismaObjectType({
name: "User",
definition(t) {
t.prismaFields(["name", "id", "avatarUrl"]);
}
});
const Query = prismaObjectType({
name: "Query",
definition(t) {
t.prismaFields([
{
name: "user",
args: ["where"]
}
]);
t.field("viewer", {
import { prismaObjectType } from 'nexus-prisma'
export const Image = prismaObjectType('Image')
import { prismaObjectType } from 'nexus-prisma'
export const Option = prismaObjectType('Option')
import { queryType } from 'nexus';
import { prismaObjectType } from 'nexus-prisma';
import { Context } from '../types';
export const Channel = prismaObjectType({
name: 'Channel',
definition(t) {
t.prismaFields(['*']);
},
});
export const Query = queryType({
definition(t) {
t.list.field('testChannels', {
type: 'Channel',
resolve: (parent, args, ctx) => ctx.prisma.channels(),
});
},
});
import { GraphQLServer } from 'graphql-yoga'
import { makePrismaSchema, prismaObjectType } from 'nexus-prisma'
import * as path from 'path'
import datamodelInfo from './generated/nexus-prisma'
import { prisma } from './generated/prisma-client'
const User = prismaObjectType({
name: 'User',
definition(t) {
t.prismaFields(['*'])
},
})
const Post = prismaObjectType({
name: 'Post',
definition(t) {
t.prismaFields(['*'])
},
})
const Query = prismaObjectType({
name: 'Query',
definition(t) {
t.prismaFields(['*'])
},
})
const Mutation = prismaObjectType({
name: 'Mutation',
definition(t) {