Giter Club home page Giter Club logo

Comments (5)

ardatan avatar ardatan commented on June 15, 2024

Please share a reproduction on CodeSandbox or StackBlitz. Thanks!

from envelop.

martin-cycle avatar martin-cycle commented on June 15, 2024

Hello @ardatan I just finished to copy my config on StackBlitz and the error keep occuring: https://stackblitz.com/edit/node-g1tdag?file=index.ts

The /graphql route let you do a simple query and the /test route gives you access to the metrics the plugin collects.

Tell me if something is not clear. I am looking into the plugin source code to see if there is something missing.

from envelop.

ardatan avatar ardatan commented on June 15, 2024

contextFactory is missing here. It is usually needed for the plugin's internals;
https://github.com/n1ru4l/envelop/blob/main/examples/express-graphql/index.ts#L28

      const {
        parse: customParseFn,
        validate: customValidateFn,
        execute: customExecuteFn,
        schema: envelopedSchema,
+       contextFactory,
      } = sentryEnvelop({
        req: request,
        res: response,
      });

      return {
        schema: envelopedSchema,
        rootValue: root,
+       context: await contextFactory(),
        graphiql: true,
        customParseFn,
        customValidateFn,
        customExecuteFn,
      };

from envelop.

martin-cycle avatar martin-cycle commented on June 15, 2024

All right! When using only the contextFactory it works on my side but the thing is that I also have a custom context. I guess I can concatenate them but this does not seem to work. I am still investigating but at least I see that this contextFactory was the missing part.

from envelop.

ardatan avatar ardatan commented on June 15, 2024

You can pass your your context to getEnveloped;

getEnveloped({ req, res, myStuff })

from envelop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.