Thank you so much, I spent a whole morning without finding a solution to the errors I had when trying to use GraphQL for my first time with MariaDB and Sequelize, you made it easy for me and I have now figured out how it works. Congratulations!
Great Article! I noticed that using post.getAuthor() and post.getComments() we tell graphql to query database for all the posts one by one. And I know this is only a template, but one wouldn't want to have as many queries to their DB. So I used sequelize' include model operation and then simply just returned post.author and post.comments. Of course this also comes at a cost of joining tables but sql table joins are better than multiple DB calls. Hope this would help someone. Also, I would create a PR if you want :)
Tech Lead/Team Lead. Senior WebDev. Intermediate Grade on Computer Systems- High Grade on Web Application Development- MBA (+Marketing+HHRR). Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
Tech Lead/Team Lead. Senior WebDev. Intermediate Grade on Computer Systems- High Grade on Web Application Development- MBA (+Marketing+HHRR). Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
Cheers man. That's great! I would even use it as template for a quick project i want to do, can you please provide the source code / (github / gitlab repo)? that would be nice! :)
what is mytoken and how do you implement it? would be useful to readers. not a very good explanation as you have it currently. inside graphql when i run the register mutation all i get is "null"
Tech Lead/Team Lead. Senior WebDev. Intermediate Grade on Computer Systems- High Grade on Web Application Development- MBA (+Marketing+HHRR). Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
I think you mean
not
That's correct, thanks
Thank you so much, I spent a whole morning without finding a solution to the errors I had when trying to use GraphQL for my first time with MariaDB and Sequelize, you made it easy for me and I have now figured out how it works.
Congratulations!
Glad to learn that you found it helpful!
Great Article!
I noticed that using
post.getAuthor()
andpost.getComments()
we tell graphql to query database for all the posts one by one.And I know this is only a template, but one wouldn't want to have as many queries to their DB. So I used sequelize'
include
model operation and then simply just returnedpost.author
andpost.comments
. Of course this also comes at a cost of joining tables but sql table joins are better than multiple DB calls. Hope this would help someone.Also, I would create a PR if you want :)
Hey, I am getting the error
Loaded configuration file "database/config/config.js".
Using environment "development".
ERROR: Error parsing url: undefined
When I am trying to use your tutorial with MySQL. Can you guide?
define the database url or IP and it will be fine
set the use_env_variable: process.env.DEV_DATABASE_URL on file "database/config/config.js"
it has worked on me
Great. Work in here
Cheers man. That's great! I would even use it as template for a quick project i want to do, can you please provide the source code / (github / gitlab repo)? that would be nice! :)
what is mytoken and how do you implement it? would be useful to readers. not a very good explanation as you have it currently. inside graphql when i run the register mutation all i get is "null"
you can use simple jwt library to handle token pretty easily