Giter VIP home page Giter VIP logo

goals's People

Contributors

dennys-bd avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

oneanwarulislam

goals's Issues

Versioning

Create version tags, and adjust the graphql packages used version as well

Error on connecting with a down API ( ConnectToApi Method)

2018/07/20 12:20:10 graphql: panic occurred: runtime error: invalid memory address or nil pointer dereference
goroutine 48 [running]:
bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/log.(*DefaultLogger).LogPanic(0x1773ba8, 0x171b800, 0xc420206720, 0x1448e60, 0x1748a20)
/Users/dennysazevedo/Workspace/go/src/bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/log/log.go:21 +0x77
bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2.1(0xc4201da1e0, 0x171b800, 0xc420206720, 0xc420053ef8, 0xc42020d3c0)
/Users/dennysazevedo/Workspace/go/src/bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/internal/exec/exec.go:161 +0x87
panic(0x1448e60, 0x1748a20)
/usr/local/Cellar/go/1.9.2/libexec/src/runtime/panic.go:491 +0x283
bitbucket.com/bemind/ang-gateway/app/resolver.ConnectToAPI(0x14caf3e, 0x3, 0xc4202e0540, 0x2d, 0xc42020a140, 0xc42020a148, 0x1403300, 0xc42020d480, 0x0, 0x0, ...)
/Users/dennysazevedo/Workspace/go/src/bitbucket.com/bemind/ang-gateway/app/resolver/helper.go:49 +0x382
bitbucket.com/bemind/ang-gateway/app/resolver.get(0xc4202e0540, 0x2d, 0xc42020a140, 0xc42020a148, 0x1403300, 0xc42020d480, 0x2d, 0xc420040960, 0x1010bc3)
/Users/dennysazevedo/Workspace/go/src/bitbucket.com/bemind/ang-gateway/app/resolver/helper.go:70 +0x7f
bitbucket.com/bemind/ang-gateway/app/resolver.(*userResolver).Deals(0xc42020a120, 0x171b800, 0xc420318f90, 0xf00000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/dennysazevedo/Workspace/go/src/bitbucket.com/bemind/ang-gateway/app/resolver/users.go:129 +0x47f
reflect.Value.call(0x1495be0, 0xc4202067f8, 0xa93, 0x14cb148, 0x4, 0xc420318fc0, 0x2, 0x2, 0xc420206720, 0xc420318fc0, ...)
/usr/local/Cellar/go/1.9.2/libexec/src/reflect/value.go:434 +0x905
reflect.Value.Call(0x1495be0, 0xc4202067f8, 0xa93, 0xc420318fc0, 0x2, 0x2, 0xa93, 0x2, 0x0)
/usr/local/Cellar/go/1.9.2/libexec/src/reflect/value.go:302 +0xa4
bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2(0xc4201da1e0, 0x171b800, 0xc420206720, 0xc42020d3c0, 0xc420202f00, 0xc420053f40, 0x171b800, 0xc420318f90, 0x0)
/Users/dennysazevedo/Workspace/go/src/bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/internal/exec/exec.go:183 +0x3c7
bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection(0x171b800, 0xc420206720, 0xc4201da1e0, 0xc420202f00, 0xc42020d3c0, 0x1)
/Users/dennysazevedo/Workspace/go/src/bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/internal/exec/exec.go:193 +0x1b7
bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections.func1(0xc4203168e0, 0xc4201da1e0, 0x171b800, 0xc420206720, 0xc42020c2a0, 0xc420202f00)
/Users/dennysazevedo/Workspace/go/src/bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/internal/exec/exec.go:74 +0x16c
created by bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections
/Users/dennysazevedo/Workspace/go/src/bitbucket.com/bemind/ang-gateway/vendor/github.com/graph-gophers/graphql-go/internal/exec/exec.go:70 +0x4c3

Modify the resolver to generate functions in model

To Goals architecture be more likely a mvc one the scaffold graphql should't create a modelResolver by default then:

instead of

func (r *modelResolver) Field() {
    return r.m.Field
}

scaffold should generate by default

func (m *Model) FIELD() {
    return m.Field
}

Goals init syntax problems

Goals.toml is being created

[project]
	name = inloco
	import_path = github.com/dennys-bd/inloco
	go_version = go1.11
	app_mode = gateway

instead of

[project]
	name = "inloco"
	import_path = "github.com/dennys-bd/inloco"
	go_version = "go1.11"
	app_mode = "gateway"

Admin

Use Browsable API #8 auto to generate an admin.

Should not be a boilerplate instead, it should be done be the goals.

Create scalar.file

Create a default scalar type for handling files submission in a Goals app

This Scalar can't be created alone, the handle must be updated to accept a multipart request.

This handle should be used only if configurated in Goals.toml to true, default nil

Browsable API

Create an Browsable API much like Django Rest Framework do

Create an option to server the Browsable API instead of the graphiql page

Try to use goimports

goimports package should be used for beautify .go files under it's usual style guide
golang.org/x/tools/cmd/goimports

Every File created by goals init, scaffolding graphql and scaffolding auth that is a go file should be under go style

Models with import keyword

Some models have the import keyword and shouldnt.

It occurs when the scarffold feature does not use time or id

scaffold graphql syntax problems

goals s graphql task 'id:ID! title:string! done:boolean!'
model.go => one line imports without \n
resolver.go => ending with 2 \n | when using id type its creating like Id instead of ID
schema.go => write a better todo

Field instead Functions to resolve

Try to change graphql package to use struct's fields instead it's function to resolve a schema field

creating some new syntax for goals (the field will have the possibility to be resolved in 4 ways):

  • e.g.

Schema:

type User {
id: ID!
docs: [String!]!
name: String!
links: [String]
}

Model:

type User struct {
ID      graphql.ID
MyDocs  []string   `graphql:"docs"` // doesn't have the same name so I should use graphql tag
myName  string // doesn't have the same name and isn't exported I should use a function
links   *[]*string `graphql:"-"` // has the same name but for whatever reason I don't use the field, i should use a function with Resolver name Appended
}

func (u User) Name() string {
    return u.myName
}
func (u User) LinksResolver() *[]*string {
    return u.Links
}

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.