Tag: go
-
Is there a VSCode plugin to go from graphql schema to the Golang resolver? [closed]
0 Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed…
-
Is there a VSCode plugin to go from graphql schema to the Golang resolver? [closed]
0 Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed…
-
Graphql-go Has No Built-In Validation For Argument/Variables Passed On?
1 I am building golang graphql endpoint with graphql-go https://github.com/graphql-go/graphql Here is chunk of my resolver.go func GetRootMutation(db *gorm.DB, req *http.Request) *graphql.Object { rootMutation := graphql.NewObject(graphql.ObjectConfig{ Name: "RootMutation", Fields: graphql.Fields{ "send_otp_email": SendOtpEmail(db, req), }, }) return rootMutation } func SendOtpEmail(db *gorm.DB, req *http.Request) *graphql.Field { return &graphql.Field{ Type: graphqlGlobal.ResultType, Description: "Send OTP to user’s email.",…
-
How to make sure my graphql subscription api is working?
0 This is my subscription resolver in golang: func (r *subscriptionResolver) CreateChatWithBot(ctx context.Context, req model.CreateChatWithBotRequest) (<-chan *model.CreateChatWithBotResults, error) { ch := make(chan *model.CreateChatWithBotResults) testString := []string{"This", "part", "is", "under", "construction", "…", " Be", "patient", "please!"} go func() { defer close(ch) for _, v := range testString { select { case <-ctx.Done(): return case ch <-…
-
How to structure Github APIv4 Golang Query for specific release
0 Using https://github.com/shurcooL/githubv4 and I’m really struggling to pull back a specific Release for a gh repo. The below code block keeps returning nothing when there is a v3 release: var releaseQ struct { Repository struct { Release struct { Author githubv4.String } `graphql:"release(tagName:$tagName)"` } `graphql:"repository(owner:$repositoryOwner,name:$repositoryName)"` } variables = map[string]interface{}{ "repositoryOwner": githubv4.String("jacobtomlinson"), "repositoryName": githubv4.String("gha-find-replace"), "tagName":…
-
How client sends close signal to graphql subscription server?
0 I’m working on a graphql server and there is one subscription API. This is the starter code I found on gqlgen documentation: // CurrentTime is the resolver for the currentTime field. func (r *subscriptionResolver) CurrentTime(ctx context.Context) (<-chan *model.Time, error) { // First you’ll need to `make()` your channel. Use your type here! ch :=…
-
How do you mask sensitive request params in gqlgen?
1 I am currently using gqlgen and would like to log request parameters for error investigation purposes. While I know how to access request parameters like below, I am concerned that this way may log sensitive information such as email addresses or passwords. srv.SetErrorPresenter(func(ctx context.Context, err error) *gqlerror.Error { goc := graphql.GetOperationContext(ctx) fmt.Println(goc.Variables) // i…
-
How to properly implement GraphQL resolvers
1 I am creating a basic Graphql project. In this project I am only fetching user details. The data is stored in database. Here is the GQL schema: type User { id: ID! username: String! email: String! age: Int address : String firstname: String lastname :String } type Query { getUserById(id: ID!): User } When…
-
gqlgen: Code Generation Fails When Binding Types: “Unable to bind to interface”
0 I am facing an issue with gqlgen’s code generation in my Go project. I have a GraphQL schema and a Go interface where I’m trying to bind a type CourseProduct to a Go struct. However, I’m encountering an error during the code generation process. Here’s a snippet of my GraphQL schema: interface Product @goModel(…
-
Go gqlgen command not found occurs
0 I’m learning Go and GraphQL. I was building a Go environment, but when I ran the gqlgen init command, I got a message in the terminal bash: gqlgen: command not found When I ran the gqlgen init command, a message appeared in the terminal. The command that was executed $ mkdir with-apollo-api $ cd…