package graph
//go:generate go run github.com/99designs/gqlgen
import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodb"
)
// This file will not be regenerated automatically.
//
// It serves as dependency injection for your app, add any dependencies you require here.
var sess = session.Must(session.NewSession())
var svc = dynamodb.New(sess)
type Resolver struct {
svc *dynamodb.DynamoDB
}
Hi all. Is there a way to get the client's IP address for subscriptions?
It's fairly easy for queries/mutations via HTTP transport (by using a middleware similar to the authentication mechanism).
I'm not sure I can access the websocket client's IP address, and InitPayload
does not contain such information
bookings
and each booking have a nested User
. If I request the booking
including the user
with a normal query, everything works as expected. But if I use the same subfields for a subscription, user
is always null.
Booking.user
, which does not seem to be called for subscriptions, but works as expected for queries and mutations.
extend type Admin {
user: User! @goField(forceResolver: true)
}
func (r *adminResolver) User(ctx context.Context, obj *model.Admin) (*model.User, error) {
panic(fmt.Errorf("not implemented"))
}
type Admin struct {
...
User *User `json:"user"` <-- I don't want this
}
2021/02/28 16:20:14 InterceptOperation
2021/02/28 16:20:14 InterceptResponse
2021/02/28 16:20:14 InterceptField
2021/02/28 16:20:14 Directive: todos
--- Here
2021/02/28 16:20:14 Resolver: Todos
I had a question. Is it possible to have multiple query resolvers?
as in normally, there is one /query route and then one can do say
query {
companies { name }
}
but I need something like.
/companies/query
/employees/query
because I need to manage access for different user type
Hi all. I have been using gqlgen for a while. I am attempting to add to a fairly large project which has been working for a while but now I am running into this error which I have not seen before. This occurs when I try to generate
generating core failed: generated!.gotpl: template: generated!.gotpl:53:38: executing "generated!.gotpl" at <$field.ComplexitySignature>: error calling ComplexitySignature: too many collisions, last attempt was graphql10
It doesnt give me too much to go off of. Where do I start to dig into the root cause of this?