maoosi/prisma-appsync

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

tomschut opened this issue · 3 comments

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

maoosi commented

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

Will look into this after the next release!

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.

maoosi commented

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