DEV Community

Cover image for Learn how YOU can build a Serverless GraphQL API on top of a Microservice architecture, part I

Learn how YOU can build a Serverless GraphQL API on top of a Microservice architecture, part I

Chris Noring on April 13, 2019

Follow me on Twitter, happy to take your suggestions on topics or improvements /Chris The idea with this article is to show how we can build micr...
Collapse
 
kayis profile image
K

Does Azure has an equivalent of AWS AppSync?

Collapse
 
softchris profile image
Chris Noring

Not sure. Have to check that with my colleagues. Here is a comparison page we put together though, service by services comparing AWS and Azure, docs.microsoft.com/en-us/azure/arc...

Collapse
 
softchris profile image
Chris Noring

ok, the answer is we don't have anything exactly like AppSync but we are actively working on building something like it

Collapse
 
rlimberger profile image
Rene Limberger

Hi Chris, any update on this? Thanks.

Thread Thread
 
softchris profile image
Chris Noring

Hi Rene. Still early days.. We are working generally on making it easier to use our services with JavaScript though, here is an example where you start with a NestJS app and turn that into serverless and you can easily hook in data sources into it dev.to/azure/build-your-first-serv..., have a look here as well dev.to/azure/introducing-nosql-azu... and here's a deployment tool to make serverless deployment easier github.com/manekinekko/hexa

Thread Thread
 
rlimberger profile image
Rene Limberger

Thanks Chris. I was most interested in an Azure equivalent to AWS AppSync. I am aware of Hasura but we would be more comfortable with a GraphQL PaaS that's offered natively by Azure. Any ETA on that? Thanks.

Thread Thread
 
softchris profile image
Chris Noring

I'll find out

Thread Thread
 
twilliamsphd profile image
Tiffany Williams

I'm also interested in this (Azure equivalent to AWS AppSync). Any update on the ETA?

Thread Thread
 
softchris profile image
Chris Noring

In progress. I'm sorry I can't give you good timeline but work is being done

Thread Thread
 
highmaturity profile image
Ricardo Garza

I am super interested in this feature you have an aproxímate ETA?

Thread Thread
 
rpostulart profile image
rpostulart

Is there already more to tell about the same on Azure?

Collapse
 
greg_r_ profile image
Greg

trying follow along and getting error with graphql api's app.js....

graphql({
^

ReferenceError: graphql is not defined
at Object. (/Users/me/devl/projects/devto/graphql.api/app.js:6:1)

Is there source code I can compoare to see if I'm doing something wrong?

Collapse
 
softchris profile image
Chris Noring

hi Greg. Sorry you got stuck.. Yes you need a const { graphql } = require('graphql'), at the top, also ensure you have run npm init -y followed by npm install graphql at the root directory of this file

Collapse
 
greg_r_ profile image
Greg

thanks, that worked. enjoyed the article.

Collapse
 
pastorsi profile image
Simon Measures

Thanks Chris. This looks like it's got potential. I think there's a presentation problem with your tutorial though.
We get "The Plan" and then it wanders on without giving us any distinct "Now start by doing this!"
At the moment I can't distinguish the point where you've stop outlining the plan and start telling us step one in actioning the plan. Could you help us by giving it a bit more structure, fleshing it out a bit more and guiding us through the build in a more step by step form.

Collapse
 
softchris profile image
Chris Noring

hi Simon, thanks for this comment. I'll definitely see how I can give it better structure/headlines. I'll write another comment once updated

Collapse
 
pastorsi profile image
Simon Measures

That will be brilliant. It's really good of you to respond. Thanks!

Thread Thread
 
softchris profile image
Chris Noring

of course, thank you for making the article better :)

Collapse
 
trevheath profile image
Trevor Heath

Thanks Chris! Great article. You should check out our Marvel GraphQL wrapper! Marvelql.com . The first query is a bit slow due to the official REST APIs shortcomings but we have implemented a cacheing strategy to speed up subsequent results. Enjoy!

Collapse
 
softchris profile image
Chris Noring

That's api.marvelql.com/ right?

Collapse
 
trevheath profile image
Trevor Heath

Yup! Github is here: github.com/Novvum/MarvelQL . Going to improve it quite a bit in the next month. Would love any feedback!

Collapse
 
softchris profile image
Chris Noring

Thanks for that Trev. Will check it out. SWAPI GraphQL is one of my favorites, this sounds fun too :)

Collapse
 
vladejs profile image
Vladimir López Salvador

"We are not there yet but part two will take us all the way"

Or...

Create a now.json file, configure it accordingly and... now

That's it, part 2 done :)

Collapse
 
softchris profile image
Chris Noring

well no.. the docker images needs to be pushed up.. before that can be done we need a resource group, a container registry. Then we need to create a service endpoint from each container.. and then we can replace each URL with a real one... and we need the serverless part too :) .

Collapse
 
vladimirnovick profile image
Vladimir Novick

Nice series, but I would suggest to follow more 3factor.app architecture approach. For GraphQL part you can use hasura.io free and open source engine. Engine will run in docker container and will connect to Postgres database auto generating GraphQL API for you. So you won't need to write any schema at all. And while the engine won't be serverless by itself it can connect to event triggers which can be connected to serverless functions. Moreover, GraphQL server you've created can be used inside the engine and stitch GraphQL schema together.

Would love to collaborate on doing some cool Azure and Hasura stuff. If you are interested, reach me out on twitter.com/VladimirNovick

Collapse
 
realflowcontrol profile image
Florian Engelhardt

Thanks Chris for this very inspiring article. As i am a PHP-Developer, i ported this to PHP, just for the sake of it ;-)

Collapse
 
softchris profile image
Chris Noring

Happy to hear that. Thanks for the link :)

Collapse
 
egemen profile image
ege • Edited

Hi Chris, Thank you for this awesome post. Just a quick remark:

I have added

"scripts": { "start": "node app.js" }

to package.json file for both APIs. So "npm start" will be executed successfully.

Cheers,

Collapse
 
softchris profile image
Chris Noring

hi.. Thank you for this comment. I'll make sure to add this info

Collapse
 
mitchelfelske profile image
mitchelfelske

Hi Chris,

Thank you for this awesome article! Simple and straight to the point. I am just starting with microservices and graphql stuff and I was able to easily follow this tutorial. :)

Collapse
 
softchris profile image
Chris Noring

Happy to hear that :) Thank you for your comment

Collapse
 
leonblade profile image
James Stine

You have a spelling error with “Trying out or GraphQL. Thanks for the great post! Looking forward to part two.

Collapse
 
softchris profile image
Chris Noring

thanks James :)