Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React and Graphql #29

Open
alexsuslov opened this issue Nov 27, 2018 · 8 comments
Open

React and Graphql #29

alexsuslov opened this issue Nov 27, 2018 · 8 comments

Comments

@alexsuslov
Copy link

Hi,
What is your opinion about, use React and Graphql for the client side?
image

@alexsuslov
Copy link
Author

I looked at the code. there is

  • a problem with id (int64) (no support in js)
  • user data move to redis

image

@alexsuslov
Copy link
Author

@jamesa
Copy link
Collaborator

jamesa commented Dec 3, 2018

It's cool that you're interested in this, would you submit a PR?

@alexsuslov
Copy link
Author

Standard Go Project Layout

https://github.com/golang-standards/project-layout

https://github.com/alexsuslov/gobb/tree/change_int_id_to_string

DONE

  • add graphql
  • add hello world
  • graphql type generator

DO

  • change int64 ID to string

TODO

  • [query] get post by id
  • [query] get board by id

@jamesa
Copy link
Collaborator

jamesa commented Dec 3, 2018

What do you think about using int (i.e. int32) instead of a UUID? A UUID seems like overkill for most Gobb usecases. It would still solve your js support issue I think? Just a thought. Really nice work on this!

@alexsuslov
Copy link
Author

int32 it's more easy

@alexsuslov
Copy link
Author

alexsuslov commented Dec 4, 2018

int64 -> int

Need:

  • type NullInt struct{}
  • template "admin_topbar"
    image

https://github.com/alexsuslov/gobb/blob/change_int64_id_to_int/TODO.md

@alexsuslov
Copy link
Author

What do u think about:

type Post struct {
	ID          int            `db:"id"`
	Message     string         `db:"title"` // 140 char
	OwnerID     int            `db:"owner_id"`
	CreatedOn   time.Time      `db:"created_on"`
	UpdatedOn   time.Time      `db:"updated_on"`
}

type PostDescription struct {
	PostId int         `db:"post_id"`
	Description string `db:"description"`
}

// https://www.postgresql.org/docs/current/datatype-geometric.html#idm46428712347808
type PostGeo struct {
	PostId int      `db:"id"`
	Point  point 	`db:"point"`
}

type PostTag struct {
	PostId	int  	`db:"post_id"`
	TagId 	int 	`db:"tag_Id"`
}

type PostSocial struct {
	PostId	int  	`db:"post_id"`
	Starts 	int 	`db:"stars"` //0-5
	Like	bool	`db:"like"`
}

type PostFollow struct {
	PostId	int  	`db:"post_id"`
	followId int `db:"follow_id"`
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants