Git Product home page Git Product logo

Comments (5)

IvanGoncharov avatar IvanGoncharov commented on September 3, 2024 1

@aperkaz Thanks for example 🎉

from graphql-lodash.

IvanGoncharov avatar IvanGoncharov commented on September 3, 2024

Hi @aperkaz,
Glad that you like our project 🎉

I am trying to mock graphql-lodash with Jest, in order to test components decorated with it.

Not sure that I understand your use case probably because I never wrote any test for React components 😞 Can you please provide more details?
Maybe you can provide a simplified version of your test that reproduces issue?

from graphql-lodash.

aperkaz avatar aperkaz commented on September 3, 2024

Hello @IvanGoncharov,
Thanks for the reply 🙂 . In my case, it seems that the issues when mocking graphql-lodash where side effects from the wrong mock of other modules 😬

from graphql-lodash.

IvanGoncharov avatar IvanGoncharov commented on September 3, 2024

where side effects from the wrong mock of other modules

@aperkaz Phew 😇

BTW. Do you use this package in production?
Would be great to see a few examples of your queries if possible?
It will help us to understand where to go with future versions.

from graphql-lodash.

aperkaz avatar aperkaz commented on September 3, 2024

@IvanGoncharov right now we are using it to transform the results of graphQL queries to a CMS (Contentful) to the right props that our React components require.
Using graphql-lodash allows to easily change the props to what the stateless components are expecting, and also easy to extend if the props in components are chagned/renamed.
Below I attach an example query:

query getPost($id: ID!) {
  post(id: $id) {
    photo: postPhoto {
      alt: title
      src: url
    }
    headline
    subtitle: postPerex
    content
    author: postAuthor @_(get: "name") {
      name
    }
    date
  }
}

from graphql-lodash.

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.