Giter VIP home page Giter VIP logo

go-graphql-starter's Introduction

Hi there ๐Ÿ‘‹

go-graphql-starter's People

Contributors

aquiseb avatar boonep avatar jmancherje avatar oscaryuen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-graphql-starter's Issues

graphql: panic occurred: runtime error: invalid memory address or nil pointer dereference

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.

query

{
  users{
    totalCount
  }
}

user

email: "[email protected]", password: "test"

token used
'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjcmVhdGVkX2F0IjoiMjAxOC0wNC0zMFQxMzo1MToyOS45NzczOTlaIiwiZXhwIjo4OTgzOTU4OTk2LCJpZCI6IlltSnFiR1k0T1RWcWJXOXdabXQyWW1WbWREQT0iLCJpc3MiOiJnby1ncmFwaHFsLXN0YXJ0ZXIifQ.bTE8-DnSYA1BRMgc1QdtyJilxZpQDbfbSqPwxVVTQMo',

error

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

About roadmap

Hi @OscarYuen!

I saw you've these goals on the roadmap:

  • Support subscription
  • Support web-socket notification and messaging

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 build server.go error

$ go generate ./schema
$ go build server.go

github.com/OscarYuen/go-graphql-starter/loader

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

Improvements for the future :)

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 ๐Ÿ‘

hasNextPage Logic

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.

Basic & Bearer Authentication

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?

undefined: AssetNames and MustAsset

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

A typo in the configuration file in the parameter jwt-expire-in

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.