maoosi / prisma-appsync

⚡ Turns your ◭ Prisma Schema into a fully-featured GraphQL API, tailored for AWS AppSync.

Home Page:https://prisma-appsync.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue: Fragments not working on the local dev server (working on AppSync)

tomschut opened this issue · comments

commented

Hi,

I've found a small bug in the dev server.
When using fragments the following error is returned:
Unknown field SeoFields for select statement on model seo. Available options are listed in green.
Our fragment is called SeoFields fyi.

On AppSync this error does not occur.

Kind regards,

Tom

I must admit I have never tried using fragments with Prisma-AppSync.

Will look into this after the next release!

commented

I'm also not sure how exactly graphql handles fragments, but what I see happening is that the identifier of the fragment, which should be interpolated at some point I suppose, is fed directly to the prisma client.

One way of fixing this would be interpolating it, but I have a feeling that there's a better solution to be found by using the dev server in another way, because the useLambdaFunction plugin probably prevents yoga from parsing anything, but that's just a wild guess.

type: 'INTERNAL_SERVER_ERROR',
code: 500,
cause: PrismaClientValidationError: ... elect: {
id: true,
layout: true
}
}
}
}
}
}

Unknown field <FragmentName> for select statement on model . Available options are listed in green.

Will be released as part of 1.0.0-rc.7.