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
Demo application built with Vue + GraphQL + Apollo stack
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
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'
]
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.