Skip to content

Integrate this project in already existing gqlgen project #145

Discussion options

You must be logged in to vote

Hey @frederikhors! We actually had this exact use case and came up with a way to not have to host two separate services and still utilize the Nautilus gateway. We accomplished this by writing our own Queryer that will resolve the query using the gqlgen executable schema. It looks roughly like this:

func (self *customQueryer) Query(ctx context.Context, input *graphqlGW.QueryInput, receiver interface{}) error {
	// ignore the input.QueryDocument as it seems that Nautilus is not constructing it correctly
	// instead, rely on the input.Query like how gqlgen wrote their handler
	doc, gqlErr := parser.ParseQuery(&ast.Source{Input: input.Query})
	if gqlErr != nil {
		return gqlErr
	}

	// more v…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by AlecAivazis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #83 on July 05, 2021 19:30.