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

Problem in bootstrapping graphql module #149

Closed
asif-ir opened this issue Jun 16, 2020 · 5 comments
Closed

Problem in bootstrapping graphql module #149

asif-ir opened this issue Jun 16, 2020 · 5 comments

Comments

@asif-ir
Copy link

asif-ir commented Jun 16, 2020

This is the error that is thrown when I try to run go generate . as mentioned in the graphql module readme.

2020/06/16 21:19:46 app: config load: root: flamingo.me/flamingo/v3/core/oauth.Module:4:10: cue: marshal error at path core.oauth.secret: cannot convert incomplete value "string" to JSON
exit status 1
main.go:4: running "go": exit status 1

Any idea?

@danielpoe
Copy link
Member

Thanks
Can you share the content of your main.go and go.mod file to check details?

Try adding a file config/config.yml

with content:
core.oauth.secret: foo

@asif-ir
Copy link
Author

asif-ir commented Jun 16, 2020

Thanks for the reply.

The config.yml suggestion didn't work.

Here are the requested files, nothing much to see here:

go.mod

module helloworld

go 1.14

require (
	flamingo.me/dingo v0.2.9
	flamingo.me/flamingo-commerce/v3 v3.2.0
	flamingo.me/flamingo/v3 v3.2.0
)

main.go

package main

//go:generate rm -f graphql/generated.go
//go:generate go run -tags graphql main.go graphql

import (
	"flamingo.me/dingo"
	"flamingo.me/flamingo-commerce/v3/cart"
	"flamingo.me/flamingo-commerce/v3/category"
	"flamingo.me/flamingo-commerce/v3/checkout"
	"flamingo.me/flamingo-commerce/v3/customer"
	"flamingo.me/flamingo-commerce/v3/order"
	"flamingo.me/flamingo-commerce/v3/payment"
	"flamingo.me/flamingo-commerce/v3/price"
	"flamingo.me/flamingo-commerce/v3/product"
	"flamingo.me/flamingo-commerce/v3/search"
	"flamingo.me/flamingo/v3"

	"helloworld/helloworld"
)

func main() {
	flamingo.App([]dingo.Module{
		new(helloworld.Module),
		new(product.Module),
		new(price.Module),
		new(category.Module),
		new(cart.Module),
		new(payment.Module),
		new(search.Module),
		new(checkout.Module),
		new(customer.Module),
		new(order.Module),
	})
}

Am I missing something significant?

@danielpoe
Copy link
Member

Hey

Thanks for the details.

The error that you see is basically the Flamingo Cue Config validation. It means a config "core.oauth.secret" is expected but not found.

The problem is not the graphql module but you are including many of the Flamingo-Commerce Modules. The cart module has the dependency to to flamingo/oauth module currently and this requires a valid configuration. We have provided an empty default in the last version of flamingo. So if you update flamingo it should work:

go get flamingo.me/flamingo/v3@c9b71d405d20bcb90eae8fb41092e61e6ba45ba5

However you will see other error messages when you try the Flamingo Commerce Modules without proper configuration. (e.g. missing product adapters)

We are currently working on a proper blogpost for the first steps with Flamingo Commerce - it is still WIP but I think it will help:
https://github.com/danielpoe/flamingo-myshop-example

Feedback welcome and let us know where we can help.

PS: Can you share for what use case you are looking into Flamingo Commerce?

@asif-ir
Copy link
Author

asif-ir commented Jun 23, 2020

This made it work. Certainly more detailed docs would be great.

I was just comparing some open source offerings for e-commerce.

@asif-ir asif-ir closed this as completed Jun 23, 2020
@danielpoe
Copy link
Member

Nice - whats your outcome and impression so far?

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