Giter VIP home page Giter VIP logo

Comments (7)

tlivings avatar tlivings commented on May 22, 2024 1

Same problem. The overwrite: true for provider doesn't seem to do anything.

Also, in the example it seems like the useValue is providing an override to the resolvers name as opposed to provider's function name. I'd expect the latter considering it is an override on provider?

In general, this doesn't seem like "injecting" a mock provider into the module. This is mentioned in the dependency injection section specifically referring to tests but remains unclear.

from graphql-modules.

ardatan avatar ardatan commented on May 22, 2024

Which version of graphql-modules are you using?

from graphql-modules.

markcdev avatar markcdev commented on May 22, 2024

@ardatan I downgraded from 0.3.0 to 0.2.18 and I can see the property now. However it still isn't switching out the implementation for the mock

from graphql-modules.

tlivings avatar tlivings commented on May 22, 2024

Any updates?

from graphql-modules.

markcdev avatar markcdev commented on May 22, 2024

Any news on this?

from graphql-modules.

ardatan avatar ardatan commented on May 22, 2024

The bug is related to overwriting an existing provider by using;

injector.provide({
   provide: ExistingProvider,
   overwrite: true,
   useClass: MockProvider
})

I created a PR for this issue, and published an alpha release;

- @graphql-modules/[email protected]
 - @graphql-modules/[email protected]

So, could you try testing your module again with this alpha version?
Please read the updated documentation before doing that;
https://github.com/Urigo/graphql-modules/blob/test-modules/docs/introduction/test-your-module.md

from graphql-modules.

ardatan avatar ardatan commented on May 22, 2024

Fixed in 0.6.5

from graphql-modules.

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.