Online store based on microservices and GraphQL.
The underlying source code for the article Using GraphQL API Gateway for Microservices in Go.
$ docker-compose up -d --build
Open http://localhost:8000/playground in your browser.
A Microservices and GraphQL based online store
License: MIT License
Online store based on microservices and GraphQL.
The underlying source code for the article Using GraphQL API Gateway for Microservices in Go.
$ docker-compose up -d --build
Open http://localhost:8000/playground in your browser.
I get a list of errors when I run docker-compose up -d --build
# github.com/tinrab/spidey/graphql/graph
graph/generated.go:843:17: cannot convert nil to type introspection.InputValue
graph/generated.go:846:54: cannot use res[idx1] (type introspection.InputValue) as type *introspection.InputValue in argument to ec.___InputValue
graph/generated.go:1003:17: cannot convert nil to type introspection.InputValue
graph/generated.go:1006:54: cannot use res[idx1] (type introspection.InputValue) as type *introspection.InputValue in argument to ec.___InputValue
graph/generated.go:1020:9: cannot convert nil to type introspection.Type
graph/generated.go:1023:30: cannot use res (type introspection.Type) as type *introspection.Type in argument to ec.___Type
graph/generated.go:1113:9: cannot convert nil to type introspection.Type
graph/generated.go:1116:30: cannot use res (type introspection.Type) as type *introspection.Type in argument to ec.___Type
graph/generated.go:1178:17: cannot convert nil to type introspection.Type
graph/generated.go:1181:48: cannot use res[idx1] (type introspection.Type) as type *introspection.Type in argument to ec.___Type
graph/generated.go:1181:48: too many errors
dont knwo if your aware but there is a pure golang equivalent of elastic called bleve.
Its very easy to use.
Its data storage medium is based on pure golang too.
Now there is a GRPC wrapper too and so will fit well into the MicroServices topology
https://github.com/mosuka/blast
Pretty cool !
want to create repository of mongDB how to create pool connection of mongo
like sql.Open
Hi @tinrab ,
First at all, thanks for your articles at outcrawl.com, I am personally learning a lot from them.
However I have a couple of doubts:
I have read the docs from https://gqlgen.com/getting-started/ where the binding rules are described:
So I am assuming that since model Account contains a property []Order it tries to resolve it without calling to Account_orders, resulting always in an empty array. Also I am totally confused on the example provided in gqlgen tutorial: both User and Todo are not pregenerated (but User would generate the same model, while Todo uses a String instead of an Object for property UserID), and the Todo_user method is added automatically to the Resolvers interface, something that is not happening in the Spidey example.
There is something that I'm missing...
Thanks!
currently i'm inside repository of order service and want to call function written in repository of account service how can i do this ??
Hello!
I've tried playing around with your project, however, after following the instructions in the README file, I can't get it to run.
After running $ vgo mod -vendor
, this is the output in the console: https://gist.github.com/Oxyrus/82e1111479f757d954a3e3121bfe1d07
And once I run $ docker-compose up -d --build
this is the output/error:
Building account_db
Step 1/3 : FROM postgres:10.3
---> b5ed9a4ab65b
Step 2/3 : COPY up.sql /docker-entrypoint-initdb.d/1.sql
---> Using cache
---> ade6d4dab6a2
Step 3/3 : CMD ["postgres"]
---> Using cache
---> 18ec8160de75
Successfully built 18ec8160de75
Successfully tagged spidey_account_db:latest
Building account
Step 1/11 : FROM golang:1.10.2-alpine3.7 AS build
---> 44ccce322b34
Step 2/11 : RUN apk --no-cache add gcc g++ make ca-certificates
---> Using cache
---> dab491024018
Step 3/11 : WORKDIR /go/src/github.com/tinrab/spidey/account
---> Using cache
---> d8621f59b3f2
Step 4/11 : COPY vendor ../vendor
ERROR: Service 'account' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder453847030/vendor: no such file or directory
My Go version is 1.10.3, I wonder if this is related to vgo because I've never used it before. Thanks a lot for any help provided!
Hi , @tinrab
I'm unable to host the project (which follow the same structure of yours project ) on jenkins (kubernetes) and also unable to remove dependencies as in API gate way (graphql ) you implemented other services also but when docker file run over jenkins it unable to import other services as these are the part of other git repos .
will you suggest how to overcome this problem.
how to make micro services without any dependencies.
error occurs go:generate command not found
I got this message if I do
$ vgo vendor
go vendor is now go mod -vendor
Change command to vgo mod -vendor
works for me
Environment
$ vgo version
go version go1.10.3 darwin/amd64 vgo:2018-02-20.1
Hi, first thanks for the example! It helps me learn.
But I found a problem while replicating your article on Medium. I can execute accountCreate but I couldn't execute productCreate, and when I checked, it has a message error like the below on the catalog container:
missing "=" after "http://catalog_db:9200" in connection info string
docker-compose successfully up and running.
Any idea what happens?
Thank you a for this great project and tutorial. I've really enjoyed it while following.
I'm trying to build a boilerplate for microservices development. And I have a few questions and request about this project.
Could you add an example to use a different language for a service?
go.mod and go.sum
files in the root of project. Is it better idea to put them inside the services so they will be loose coupled.
For database, Is there any persistent layer to keep the data while relaseing application?
how to get header token
This is a really nice example.
I would like to try and extend it and make a few PR's and am curious about a few things
Subscriptions ? This is still evolving with graphql but I think it would be very useful to add this.
Codegen of db.
The new gnorm project looks pretty nice. It's a db first approach which might seem weird considering graphql is top down approach but I like aging the flexibility in the middle of you know what I mean.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.