-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Prisma binding #164
Comments
I am getting this as well... the post deploy hooks don't seem to work :( If I run in a script: "prisma deploy && graphql get-schema && graphql prepare" it generates the file as expected |
Thanks for reporting! I let this issue open as a reminder for us to create better docs. Would be cool to get your feedback @marktani & @abelovic if switching to |
Alright might need a slight guide on how to implement this because the example is a bit different to mine, I copied the part of the graphqlconfig.yml relevant to Prisma, but it doesn't seem to generate now with graphql get-schema or graphql codegen but runs fine without errors. |
@timsuchanek - I am having trouble getting this to work as well using the graphql boilerplates structure that most of us are using. Here is my graphqlconfig: When I run the following config I get: "Couldn’t find prisma.yml file. Are you in the right directory?" Not sure why I am getting this when I have set the path :/
|
Running this doesn't give the error but doesn't generate the file either which I think is what @OGNeutron is running into as well:
|
Running into similar errors .. Would also love some clarity and better documentation around these configs... they are fairly esoteric and difficult to reason about. I would almost rather just have a few scripts to imperatively generate everything instead :) |
Still haven't got it working with my current project, also not getting any errors or generated files, I tried different setups, I can get graphql get-schema working, but codegen just runs and shows nothing. |
These docs are also out of date now. I'd help update the docs except I don't understand how |
The whole 1.8 release seems too rushed considering there are so many breaking changes. This has caused so many problems for me. I pay for the prisma cloud and the whole point of this is so I can forget about it and it just works. This has been far from the truth. This is now consuming 90% of my time because it seems like every time I upgrade something breaks. Since this is the DAL/ORM (or whatever you want to call it) it basically cripples my app development until I can resolve it :( The prisma team needs to consider doing pre-releases and properly test/document this stuff before releasing to the masses. I do not want to pay to be a beta tester for prisma. |
I'm feeling the same. Breaking changes are fine, but you need documentation! At least the team should give us a migration guide for anything changed. Spending 90% of my time to trace what's breaking is breaking my heart to Prisma. |
After hours of researching, the following finally seems working for prisma-blinding 2.0. projects:
app:
schemaPath: source/schema.graphql
extensions:
endpoints:
default: 'http://localhost:4000'
database:
schemaPath: source/generated/prisma.graphql
extensions:
prisma: database/prisma.yml
codegen:
generator: prisma-binding
language: typescript
output:
binding: source/generated/prisma.ts Note: the |
@abelovic, @alvis and everybody else who has had a frustrating experience with the 1.7 and 1.8 releases: You are absolutely right! Our release process has been too hectic and unfortunately this has resulted in us releasing buggy software and not being able to update the documentation in time. We are doing two things to address this issue:
I am really sorry about the frustrating experience and I promise you that we will do better in the future. |
Got a problem with importing other .graphql files into the schema. With code gen, To fix it, we should wrap it with return buildSchema(importSchema(input)) @sorenbs: should I make a quick PR to fix it? |
Thanks for the suggestion @alvis ! Yes, it would be awesome if you could do a PR for that :) @abelovic : In the new prisma.yml you also need to add the following lines of code: hooks:
post-deploy:
- graphql get-schema
- graphql codegen Here is a running example: https://github.com/graphql-binding/graphql-binding/blob/master/examples/full-example/prisma.yml |
I've changed prisma.yml and graphqlconfig.yml but I am still getting no results, I am still getting this:
For some reason it's not generating the files |
I think the input field is unnecessary i.e. this should work projects:
app:
schemaPath: "src/schema.graphql"
extensions:
endpoints:
default: "http://localhost:4000"
db:
schemaPath: src/generated/prisma.graphql
extensions:
prisma: prisma.yml
codegen:
- generator: prisma-binding
language: typescript
output:
binding: src/generated/ts-prisma.ts My suggestion is to have the hook setup in your hooks:
post-deploy:
- graphql get-schema
- graphql codegen Then run |
I've done that, I have added the input field, since I wrote that post, but it seems not to be working, also lately prisma deploy hasn't been working(except database migration), but running the graphql commands are working, get-schema runs perfectly, but codegen isn't working at all, if you want to clone my repo and give it a spin, I must be missing something. |
@OGNeutron check out my fork of your repo It should be working by running Note: Remember to change your endpoint in |
@timsuchanek - yes I had the hooks but the problem I and @OGNeutron have is those hooks are not executing once prisma deploy finishes. They say they do (with no errors) but do not actually update either the prisma.graphql or the prisma.js files :( I have rolled back to 1.7.4 and prisma-binding 1.5.19 for my project in the meantime. Everything works as expected so I suspect there is something going on in both the hooks and the codegen. If it's indeed a config issue on our end then it would be helpful if get-schema and codegen provide and error message. Also thanks for your example but the majority of us use the boilerplates. I get you are trying to simplify the issue but there leaves too much room for configuration error (on our part) when we try to apply those changes. I already have lots of other things going on i.e. serverless, webpack, lambda as do I suspect most others do. @alvis and @OGNeutron repos are more useful because they are much closer to our real world implementations. Could you update yours? I think a webpack boilerplate is long overdue as well so hopefully @sorenbs has that on his roadmap hint hint :) @alvis - thanks for providing a repo. I will try and check that out today and see if it helps :) |
The changes didn't help, I still get the same response √ Code for project db generated to src/generated/ts-prisma.ts when doing graphql codegen and still not generating files, it's a weird issue. |
@OGNeutron have you tried to clone the repo and redo everything from the start? |
Cloned it, changed to my endpoints and so on, but I still can not get it to generate the prisma-bindings, nothing wrong with the graphql get-schema, are you saying you got it working? Because I couldn't with the forked version. |
I also have similar issues with the same configuration. Is it possible it could be due to environment dependencies like node.js or npm? Could be we're getting different versions of prisma-bindings dependencies |
🤔 I tried to clone the repo to my another computer and it works as expected. I've node 10.1 both set up in my computers, but I don't think it's the cause. @OGNeutron: did you run |
Yeah, I've done it both ways, I've prisma deployed it and graphql codegen and I get the same response and I am also Node 10.1, and actually graphql get-schema only works if I do it manually, it doesn't work if I do prisma deploy, neither command works. I get the same for the forked version and the one I've changed to be the same. |
I had two issues but now it is working 👍 First one was that Second one was that the syntax I was using in the |
Can you show your graphqlconfig.yml so I can compare with mine, maybe I have a similar issue as-well? |
@OGNeutron here it is:
|
It's the same one, my troubles continue with the adventures of OGNeutron, such a weird issue. Bloody codegen. Well, when I start the server I am getting these wonderful wanings:
|
I'm suspecting windows be the cause of the problem? May be some of the packages are not working properly under windows? |
I kinda got the server working, just missing those ts-types & prisma-binding which codegen is meant to provide, well I dual boot with Ubuntu so I will give it a spin on that, but I doubt it, giving that the other graphql commands work, I must be doing something wrong with codegen. Also prisma deploy doesn't seem to work, have to manually call graphql commands. |
Yep, it's a bug for Windows, I just tried it with Ubuntu 18.04 and it worked perfectly, for some reason it doesn't work for Windows, I am 1709(I believe latest) and it seems to be the main cause for why prisma deploy or codegen isn't working. |
Interesting. Maybe an issue related to how environment variables are handled? |
@timsuchanek: just to let you know that a PR (#169) is made for supporting import in codegen. |
I'm having the same issue on a mac:
|
@hyrecar: could you make a repo for us to check? |
@alvis, I realized that my case is actually different from this issue. For my case, I am actually generating bindings for the gateway which wraps the prisma schema. So the codegen works for the prisma binding itself, but when I try to do it for the wrapper, it's giving me the issues. I'll dig deeper into it and find out exactly what is going on. |
@OGNeutron Hey, do you still have the problem ? I'm facing the exactly same issue : codegen show a success message but generate nothing I'm running on Windows and the 2.0.2 prisma-binding [EDIT] : I can put a crazy and non-existing path, I still get the same message
|
Nope, I still have the same issues, it's seem to be Windows having the issue, because it's working with Ubuntu, so it seems they need to do some testing for Window versions. |
Hi All, We released a fix today that fixes the Note that Meanwhile, you can get the latest Please let me know if that does not work. |
Awesome thanks for all your feedback in this thread! The general issue seems to be resolved by @divyenduz' recent work, so I'm closing this. Please open a new issue if you are encountering further problems! 🙂 |
Is there another issue open for the hooks not running on windows? If not this should not be closed because it is only partially fixed. Those hooks should run otherwise it should be removed from the documentation (and updated with the intermediary fix) until there is a "complete" solution |
@abelovic : Hey, thanks for reaching out. This was resolved in Thanks! |
@divyenduz I didn't realize this fix was in prisma cli 1.9 ;P I just tried it out on the hooks seem to be running in windows correctly :) Thank you! |
I am still experiencing this issue on windows. I have the latest version 1.16.4 and with the changes suggested by Alvis I get the confirmation that the processes were successful but nothing is actually created. I also did |
@OGNeutron commented on Fri May 11 2018
When I graphql-prepare I am getting a type issue with Prisma in prisma.ts
@marktani commented on Fri May 11 2018
Please share a minimal reproduction so we can look into this 🙂
@OGNeutron commented on Fri May 11 2018
Alright, I just do the normal prisma deploy, the database sets up fine and even the post hooks show fine:
But they don't actually generate the files, so I do it manually and it shows up, but than I get that issue with the prisma.ts file where all three, query, mutation and subscriptions give similar errors.
https://github.com/OGNeutron/Prisma_main_hub
The text was updated successfully, but these errors were encountered: