Giter Club home page Giter Club logo

vue-graphql-presentation's Introduction

Hello ๐Ÿ‘‹

My name is Natalia and I contribute mostly to Vue.js ecosystem. You might know me as a co-author of Vue documentation

If you want to support my open source activities, consider โค๏ธ sponsoring me

vue-graphql-presentation's People

Contributors

dependabot[bot] avatar nataliatepluhina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vue-graphql-presentation's Issues

Suggestion: Sample TypeScript unit test

Hi I like your implementation in unit testing GraphQL using JavaScript, I tried to replicate your unit test on my project and was able to pass all the test however when I switched to TypeScript I encountered an error of:

Type 'ApolloClient<NormalizedCacheObject> & { setRequestHandler: (query: DocumentNode, handler: RequestHandler<any, any>)
=> void; }' is missing the following properties from type 'ApolloClient<any>': store, writeData, initQueryManagerts(2739)

apollo-provider.d.ts(16, 5): The expected type comes from property 'defaultClient' which is declared here on type
'{ defaultClient: ApolloClient<any>; defaultOptions?: VueApolloComponentOptions<Vue> | undefined; 
clients?: { [key: string]: ApolloClient<any>; } | undefined; watchLoading?: WatchLoading | undefined;
errorHandler?: ErrorHandler | undefined; prefetch?: boolean | undefined; }'

on this line: apolloProvider = new VueApollo({defaultClient: mockClient})

mock-apollo-client has been updated to version 1 which is incompatible with the @nuxtjs/apollo version ^4.0.1-rc.5 at the time of this writing. What we done is we downgraded to version 0.x of mock-apollo-client however we still encountered an error of Error sending the query 'myCollection' TypeError: Converting circular structure to JSON.

It might be helpful to add this jest.config.js:

module.exports = {
  setupFiles: ['<rootDir>/jest.setup.js'],
  moduleNameMapper: {
    '^@/(.*)$': '<rootDir>/$1',
    '^~/(.*)$': '<rootDir>/$1',
    '^vue$': 'vue/dist/vue.common.js'
  },
  moduleFileExtensions: ['ts', 'js', 'vue', 'json'],
  transform: {
    '^.+\\.ts$': 'ts-jest',
    '^.+\\.js$': 'babel-jest',
    '.*\\.(vue)$': 'vue-jest',
    '\\.(gql|graphql)$': ['@jagi/jest-transform-graphql']
  },
  collectCoverage: true,
  collectCoverageFrom: [
    '<rootDir>/components/**/*.vue',
    '<rootDir>/pages/**/*.vue',
    '<rootDir>/plugins/**/*.vue',
    '<rootDir>/store/**/*.vue'
  ]
}

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.