oscaryuen / go-graphql-starter Goto Github PK
View Code? Open in Web Editor NEWThis repository uses graph-gophers/graphql-go to build a starter web application
License: MIT License
This repository uses graph-gophers/graphql-go to build a starter web application
License: MIT License
Hi,
I just got that error while trying the step described on the readme (using an auth token). I'm really new to the go world so I probably have done some thing stupid but just in case here is the error and the query and auth parameters that created it.
{
users{
totalCount
}
}
email: "[email protected]", password: "test"
token used
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjcmVhdGVkX2F0IjoiMjAxOC0wNC0zMFQxMzo1MToyOS45NzczOTlaIiwiZXhwIjo4OTgzOTU4OTk2LCJpZCI6IlltSnFiR1k0T1RWcWJXOXdabXQyWW1WbWREQT0iLCJpc3MiOiJnby1ncmFwaHFsLXN0YXJ0ZXIifQ.bTE8-DnSYA1BRMgc1QdtyJilxZpQDbfbSqPwxVVTQMo',
2018/04/30 14:08:36 graphql: panic occurred: runtime error: invalid memory address or nil pointer dereference
goroutine 13 [running]:
github.com/graph-gophers/graphql-go/log.(*DefaultLogger).LogPanic(0xc26c78, 0x9aa2c0, 0xc4200abb00, 0x8b6180, 0xbf7e40)
/home/newtrax/workspace/experiments/go/src/github.com/graph-gophers/graphql-go/log/log.go:21 +0x77
github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2.1(0xc4200c4180, 0x9aa2c0, 0xc4200abb00, 0xc420066ef8, 0xc42000c220)
/home/newtrax/workspace/experiments/go/src/github.com/graph-gophers/graphql-go/internal/exec/exec.go:161 +0x87
panic(0x8b6180, 0xbf7e40)
/usr/lib/go-1.10/src/runtime/panic.go:505 +0x229
github.com/OscarYuen/go-graphql-starter/resolver.(*Resolver).Users(0xc26c78, 0x9aa2c0, 0xc4200abb90, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/newtrax/workspace/experiments/go/src/github.com/OscarYuen/go-graphql-starter/resolver/user_query.go:36 +0xff
reflect.Value.call(0x8c31c0, 0xc26c78, 0xa13, 0x9412cc, 0x4, 0xc4200abc20, 0x2, 0x2, 0x3, 0xc4200abc20, ...)
/usr/lib/go-1.10/src/reflect/value.go:447 +0x969
reflect.Value.Call(0x8c31c0, 0xc26c78, 0xa13, 0xc4200abc20, 0x2, 0x2, 0xa13, 0x2, 0xc420093200)
/usr/lib/go-1.10/src/reflect/value.go:308 +0xa4
github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2(0xc4200c4180, 0x9aa2c0, 0xc4200abb00, 0xc42000c220, 0xc420036a00, 0xc420066f40, 0x9aa2c0, 0xc4200abb90, 0x0)
/home/newtrax/workspace/experiments/go/src/github.com/graph-gophers/graphql-go/internal/exec/exec.go:183 +0x372
github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection(0x9aa2c0, 0xc4200abb00, 0xc4200c4180, 0xc420036a00, 0xc42000c220, 0x1)
/home/newtrax/workspace/experiments/go/src/github.com/graph-gophers/graphql-go/internal/exec/exec.go:193 +0x1aa
github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections.func1(0xc4200bca90, 0xc4200c4180, 0x9aa2c0, 0xc4200abb00, 0x0, 0xc420036a00)
/home/newtrax/workspace/experiments/go/src/github.com/graph-gophers/graphql-go/internal/exec/exec.go:74 +0x16c
created by github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections
/home/newtrax/workspace/experiments/go/src/github.com/graph-gophers/graphql-go/internal/exec/exec.go:70 +0x476
Hi @OscarYuen!
I saw you've these goals on the roadmap:
Could you tell me if you are currently working on that please ๐ ?
I'm just discovering GraphQL in Golang instead of JS and it would be great to use streams ๐
Thank you
$ go generate ./schema
$ go build server.go
loader/user.go:17:21: cannot use userLoader literal.loadBatch (type func("golang.org/x/net/context".Context, dataloader.Keys) []*dataloader.Result) as type dataloader.BatchFunc in return argument
Please advise fix
Hey @OscarYuen thanks again for your work ๐
Just to warn you that since "go" is releasing a new package manager (ex-"vgo") currently in the go1.11beta2 CLI release, it favors downloading latest releases over latest commits when you specify no version for the package.
I had a lot of issue with github.com/jteeuwen/go-bindata
since the latest release was published in 2014 while there is more recent commits. So when I was trying to generate my schema the "MustAsset" function was missing:
schema\schema.go:11:8: undefined: MustAsset
To simply solve that I advise users to switch to a brand new repository that is supposed to aggregate all forks of go-bindata:
https://github.com/go-bindata/go-bindata
That works well for me ๐
PS: The coming package manager (go modules) is really cool ๐
Hi OscarYuen,
on your user_connection_resolver.go on func PageInfo you have function like this:
func (r *usersConnectionResolver) PageInfo() *pageInfoResolver { return &pageInfoResolver{ startCursor: service.EncodeCursor(r.from), endCursor: service.EncodeCursor(r.to), hasNextPage: false, } }
It seems hasNextPage is always false. how is the logic to provide real hasNextPage value?
Thanks.
I have used the suggestive blitter.se. The generated basic gives me an error of not being long enough.
2018/12/29 15:43:25 crypto/bcrypt: hashedSecret too short to be a bcrypted password
The Bearer
example in the graphql.html file is obviously tailored for an example you had used.
I would suggest a clearer explanation of how you generated the Basic Authorization key. Is this possible in the near future?
Hi, I'm very interested in taking a look at this project and maybe contribute. But I'm getting the following error... Could you please enlighten me on what's going on?
Thanks in advance
$ go build server.go
# github.com/OscarYuen/go-graphql-starter/schema
../github.com/OscarYuen/go-graphql-starter/schema/schema.go:9:23: undefined: AssetNames
../github.com/OscarYuen/go-graphql-starter/schema/schema.go:10:8: undefined: MustAsset
Hi,
I am using your repository for the purpose of exploring GraphQL with Go and I noticed a typo in the file configuration, in the jet-expire-in
.
For the correct signature of the jwt, you need to remove the letter s
.
[auth]
jwt-secret = "[you_secret_here]" # you secret here
jwt-expire-in = "3600" # 1 hour in seconds
If you do not make changes, then after reading the configuration file, the value of this parameter will take the value with the letter and the output after conversion to Unix()
you will get a completely different value than 1 hour.
You can check it: try to logging the parameter after read configuration file.
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.