almilo / granate

Granate container for annotated GraphQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could you please provide a working API sample

gsvitak opened this issue · comments

Hello,

Thanks for the great work.

I was able to get https://github.com/almilo/annotated-graphql-server working but I think this might be a little older than the current work of granate.

Could you please provide an working example how to use granate in an express or koa app via the API? The tests are a little hard to follow and the link on the readme I think is broken.

Thanks,
G

Hi @gsvitak,

I guess this is what you are looking for: https://github.com/almilo/granate-cli/blob/master/src/serve/index.ts#L43 The server functionality with express is in granate-cli.

Which link is broken?

cheers,
Alberto

Hi @almilo

Thank you for the response. I am sorry, I think I should done a better job of explaining what we are trying to do.

We have an existing koa app and I would like to try to use granate to wrap a REST API into our project. I noticed on the README, it mentions an API. The README mentions to refer to the tests, but the link on the page to the test is broken. Do you have some documentation or a working example on how to use the API? Is the cli the best example?

Thanks
Greg

Hi Greg,

Thanks for reporting the broken link.
Yes, I think the cli is the best example as it is embedding granate in an express app.

Hope it helps!
Alberto

Thank you!

Greg