Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 22 16:20
    razorness commented #1516
  • Apr 22 07:10
    NateScarlet commented #1369
  • Apr 22 06:23
    NateScarlet commented #1369
  • Apr 22 05:59
    NateScarlet commented #1369
  • Apr 21 08:05
    saminahbab commented #1192
  • Apr 21 08:01
    saminahbab commented #1090
  • Apr 21 04:29
    rokiyama commented #1402
  • Apr 21 04:01
    diffuse commented #1402
  • Apr 21 03:48
    diffuse commented #1402
  • Apr 21 03:04
    rokiyama commented #1402
  • Apr 20 21:29
    jakesyl commented #1048
  • Apr 20 20:38
    jakesyl closed #1520
  • Apr 20 20:38
    jakesyl commented #1520
  • Apr 20 20:37
    coveralls commented #1520
  • Apr 20 20:35
    jakesyl reopened #1520
  • Apr 20 20:34
    coveralls commented #1520
  • Apr 20 20:34
    jakesyl commented #1048
  • Apr 20 20:32
    jakesyl closed #1520
  • Apr 20 20:32
    jakesyl converted_to_draft #1520
  • Apr 20 20:32
    jakesyl opened #1520
Alik Send
@aliksend
I can fix it in my PR but then check-fmt will fail
Alik Send
@aliksend

fix for #965

For #956 *

Akhil Indurti
@smasher164

Hey folks, my team’s use-case requires creating and destroying connections/pool at the resolver-level. We want to destroy these connections when a parent and its children are done. Is there any way to know, for a particular parent, when its child resolvers have finished executing?

Thanks,
Akhil

Kirill Tatchihin
@rbUUbr
hello everyone! I would like to access field context in dataloader’s fetch function, can I do this?
1 reply
sateeshpnv
@sateeshpnv

Has anyone got gqlgen run within a bazel project?

It fails with "merging failed: unable to find type github.com/99designs/gqlgen/graphql.Boolean". vendor directory does have these types. I guess I am not able to tell gqlgen (or go) to look for the types in vendor directory.

sateeshpnv
@sateeshpnv
@vektah ^, please help.
Muhammad
@harmnot
any example Unmarshal & Marshal primitive.ObjectID for MongoDB for model ? I want make scalar ObjectID to primitive.ObjectID
Muhammad
@harmnot

I was put this

  ObjectID:
    model:
      - go.mongodb.org/mongo-driver/bson/primitive.ObjectID

it was created on my model_gen.go
I got error validates like this : validation failed: packages.Load: .../resolver/generated.go ec.unmarshalInputObjectID undefined (type *executionContext has no field or method unmarshalInputObjectID)

I am afraid when into production this will make issue on my app ,
any idea?

Muhammad
@harmnot
trying again like this:
func MarshalObjectID(v primitive.ObjectID) graphql.Marshaler {
    return graphql.WriterFunc(func(w io.Writer) {
        err := json.NewEncoder(w).Encode(v)
        if err != nil {
            panic(err)
        }
    })
}

func UnmarshalObjectID(v primitive.ObjectID) (primitive.ObjectID, error) {
    return v, nil
}
got
cannot use v (variable of type interface{}) as primitive.ObjectID value in argument to model.UnmarshalObjectID
4 replies
Swarup Donepudi
@swarupdonepudi
Anyone using Galen to run a subscription server?
2 replies
gqlgen
Muhammad
@harmnot

is there any example for Add header in Testing with gqlgen ?

testClient.AddHeader("Token",  TOKEN_HERE)

I wrap them in MustPost() but got token contains an invalid number of segment I bet the header was nil or can't set up

Swarup Donepudi
@swarupdonepudi
@vektah do you know if anyone is using gqlgen to run a subscription server.?
Kaarthik Rao Bekal Radhakrishna
@karthikraobr
Has anyone bound a graphql type that implements an interface to a protobuf message?
Eric Meier
@BitPhinix
@swarupdonepudi i am
Nur Kutlugallyamov
@milQA
Hi everyone. Could you look at my PR(#1209) and give me feedback?
Does the package need this (un)marshaler?
What should I add or remove from PR(#1209)?
Artem
@art1415926535

Can I create type with query: Query! field?

I am trying to generate by

type Login {
  query: Query!
  user: User
}

and get error

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x8850c3]

goroutine 1 [running]:
github.com/99designs/gqlgen/codegen/config.(*TypeReference).IsPtr(...)
...
exit status 2
Tassios Marios
@mariosttass
Has anyone used dataloaders with field collection ? Because I am trying to do that but I have some issues with the context.
Tassios Marios
@mariosttass
@vektah Hi guys, here I have also created an issue regarding the question that I already asked, if somebody faced the same issue or there is a workaround let me know please. Thank you in advance !! 99designs/gqlgen#1225
Ng Thong
@ngthorg
who have a example gqlgen vs relay connection ?
i don't know use global ID in gqlgen :(
Swarup Donepudi
@swarupdonepudi
Thanks @mariosttass
g
@SimplyKnownAsG
Is there a way to get the name of each operation as it is being performed using middleware?
Javi Roberts
@javiroberts
Hi everyone! Is there a way to define a naming schema for resolver files? Such as resolver/schema.go instead of schema.resolvers.go
Swarup Donepudi
@swarupdonepudi
+1 for the ability to override the name for resolvers. Not sure if gqlgen supports it.
Kashif Shaikh
@kashifshaikh
@art1415926535 you can’t embed Query field into another field
Alec Benzer
@AlecBenzer
hey, trying to get started w/ gqlgen (edit: sorry, cat hit enter)

we have a monorepo, and I want to have the gqlgen "root" be a subdirectory of the overall repo. is that possible?

I'm getting an error like module gitlab.com/mycompany/monorepo@latest found, but does not contain package gitlab.com/mycompany/monorepo/go/path/to/gqlgenroot/graph/model

maybe a related clarifying question... in a setup where the gqlgen "root" is not the repo root, a) where should gqlgen.yml go, b) where should the paths in gqlgen.yml be relative to?
mtatarau90
@mtatarau90
Hi guys, i have a question, is a way to get a query fields not from a rezolver, but from a middleware?
Kaarthik Rao Bekal Radhakrishna
@karthikraobr
oCtx := graphql.GetOperationContext(ctx) start, query, variables := oCtx.Stats.OperationStart, oCtx.RawQuery, oCtx.Variables
Have you tried this?
sateeshpnv
@sateeshpnv

While migrating from v0.10.2 to v0.11.3, generated.go doesn't compile:

/private/var/tmp/_bazel_sateesh/.../sandbox/darwin-sandbox/1531/execroot/__main__/bazel-out/darwin-fastbuild/bin/src/.../generated.go:4521:20: undefined: gqlparser

generated.go does not import gqlparser github.com/vektah/gqlparser/v2. However, it is used as var parsedSchema = gqlparser.MustLoadSchema(sources...)

How did the gqlparser import vanish from generated.go file?

4 replies
Erik Müller
@asterikx
Hi all, is it possible to generate only the model files? I don't need the server/resolver part as I'm using AWS AppSync. But I have some Lambdas that should use the same models.
Erik Müller
@asterikx
Is there an option to ignore "undefined" directives? I'm using @aws_cognito_user_pools (see AppSync Guide) and I want gqlgen to ignore/skip it as authentication is already handled by AppSync.
Olivier Refalo
@orefalo_gitlab
Hi.. a bit confused about gqlgen. anyways.. I tried to get the federation-demo working on the latest version with no success.
any idea?
Olivier Refalo
@orefalo_gitlab
schema.resolvers.go:43:40: ProductResolver not declared by package generated
/schema.resolvers.go:46:37: UserResolver not declared by package generated
pulling my hairs
how do I tell gqlgen to generate resolvers?!
Olivier Refalo
@orefalo_gitlab
tried with this
models:
  Query:
    fields:
      product:
        resolver: true # force a resolver to be generated
      users:
        resolver: true # force a resolver to be generated
Olivier Refalo
@orefalo_gitlab
I got it to compile by changing this:

// Product returns generated.ProductResolver implementation.
func (r *Resolver) Product() productResolver { return productResolver{r} }

// User returns generated.UserResolver implementation.
func (r *Resolver) User() userResolver { return userResolver{r} }

type productResolver struct{ *Resolver }
type userResolver struct{ *Resolver }
still the schema Query doesn't show neither Product nor User
actually... the schema doesn't have a Query type.. so I would think it's normal. ok need to sleep
Olivier Refalo
@orefalo_gitlab
ok - I got it working... at last
Simeon Miteff
@simeonmiteff
Hi There. is graphql.AddError() expected to work in subscription resolvers?