Closed webdevisme closed 5 years ago
Oh wow. I think I see the problem. I’m assuming you have absolutely NO types in your scheme that are mutable, so my project is emitting an empty GraphQL mutation type (which apparently is invalid).
I’ll fix when able, but, I think a workaround for you would be to just add a junk, made up type to your project setup that’s NOT readonly. Just make up a name and give it a value for table. It’ll emit entries in the GraphQL endpoint that aren’t valid, but just don’t call them and you should be fine.
And like I said, I’ll look to fix this properly this week sometime.
Ahh, ok, that does explain it.
Thanks, I'll look forward to the update (as i'm not keen on having a writeable endpoint on the project I'm working on!)
I'll be digging into your code more as I go, only just scraping the surface at the moment!
Yo should be fixed with 0.10.3 - give it a try and let me know
Hi, thanks for that. I've just had a chance to try that out and no joy unfortunately.
I'm still getting
(node:16603) UnhandledPromiseRejectionWarning: SyntaxError: Syntax Error: Expected Name, found } (216:1)
214 | type Mutation {
215 |
> 216 | }
| ^
at n (/home/user/project/node_modules/prettier/parser-graphql.js:1)
error, unless I add a zombie writable type. :(
I've created a pull request #43 that might fix it :)
Hmm.. there's still a problem relating to the writeableNames array being populated (even with only readonly types) which is causing problems in the master schema and resolver.
For some reason, the readonly flag is not being passed through with each module.
Oh ... try moving the readonly to right inside your projectSetup file, instead of adding it dynamically. See project 10 inside my test folder.
Hm - I tried that, and everything still works, fine.
Honestly, I'd pull the repo, and see if you can get the tests to run. Make sure you have mongod running in the background somewhere. Really just see if you can get
npm run test10
to run.
If you can, see if you can tinker with the projectSetup to somehow, some way reproduce what you're seeing. If you can, just send me a PR with the updates and I'll absolutely have a look. But from what I'm seeing now, everything should work fine.
You're right. And apologies for the bad PM.
I deleted the node_modules and re installed, and everything's good now. (strange as I'd checked that it had updated, but was getting errors!?)
Great job, thanks :)
Yeah! Glad to hear.
Geat tool, but I'm having real problems getting the readonly flag working. Inital schema:
And running:
Results in:
My setup:
Any ideas?