Questions

  • 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 := […]

  • Why list comprehensions create a function internally?

    16 This is disassembly of a list comprehension in python 3.10: Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import dis >>> >>> dis.dis("[True for _ in ()]") 1 0 LOAD_CONST 0 (<code object <listcomp> at 0x7fea68e0dc60, file "<dis>", line 1>) 2 […]

  • How to test multiple input events using StepVerifier

    0 I want to test receiving multiple events for GraphQl subscription. For this I tried to use the following code: StepVerifier stepVerifier = StepVerifier.create(flux) .expectSubscription() .expectNext(expectingEvent1) .expectNext(expectingEvent2) .thenCancel() .verifyLater(); graphQlService.sendEvent(sendingEvent1); graphQlService.sendEvent(sendingEvent2); stepVerifier.verify(); Method sendEvent contains the following logic: fluxSinks.forEach(fluxSink -> fluxSink.next(response)); But it seems that in this test only the first event is sent, judging […]

  • How to decide merge order schemas graphql codegen

    0 I’m trying to merge two separate graphql schemas one which is provided by my CMS endpoint and a local schema for additional typehinting (my CMS schema isn’t precise enough). Is there a way to configure the merge order in the graphql codegen config? I’ve been able to merge both schemas and handle the override […]

  • why how can i fix the error: variable XX not found with hydrogen and codegen?

    0 I am very new to hydrogen / react in general. I am playing around with hydrogen 2 and the base app they install when setting up a site. Playing around with the ($locale).products.$handle.jsx file I have created an extension to the product query which grabs a few new meta fields. I then import that […]

  • Unexpected LAMBDA_RUNTIME Failed to post handler success response. Http response code: 413 error

    14 So I have a serverless express application running in a Lambda. One request (response size around 800KB) keeps returning a LAMBDA_RUNTIME Failed to post handler success response. Http response code: 413. error. I thought it could be due to some internal logic timing out, and added logs, and all the fetch and processing takes […]

  • TypeError with Pothos Graphql and prisma-plugin

    0 I am building a social app with nextjs for frontend and SSR, graphql-yoga server, and pothos for typesafe graphql and prisma for my db. I have followed all the example given in all their documentation for integration. However, I am getting a confusing error. ERR Error: Type Post must define one or more fields. […]

  • Strawberry with social_django

    0 How can I use social_django with strawberry graphql? With graphene, I inherited my strawberry.type from SocialAuthJWT I used in grapgene like this. class SocialAuth(graphql_social_auth.SocialAuthJWT): user = graphene.Field(UserType) @classmethod def resolve(cls, root, info, social, **kwargs): social.user.is_verified = True social.user.save() token = get_token(social.user) return cls(user=social.user, token=token) I’d like to log in with google. python python-3.x django […]

  • Are records syntactic sugar for classes?

    11 I recently discovered Java records, and it was amazing to learn about their existence and purpose. However, I began to wonder if they are essentially just classes behind the scenes. Does this mean that during compilation, they get converted into an explicit class with final private fields, a public constructor, and the necessary getters? […]

  • Dynamic Python Function Generation from GraphQL Schema for API Requests

    0 I’m looking for a method to dynamically generate Python functions that correspond to the queries and mutations defined in a GraphQL schema. After obtaining the schema, I want a system that can automatically create these functions, so I can simply import the generated code into my Python project and call the functions with the […]