storybook-addon-mock
storybook-addon-mock copied to clipboard
thank you -- this worked right away with no trouble (storybook, urql, vue3, graphql)
thank you! I initially tried using an urql-specific addon and there were many issues and it didn't work. I really like that its possible to generate dynamically created responses later if I need those
export const NORMAL = Template.bind({});
NORMAL.decorators = [ vueRouter() ];
NORMAL.parameters = {
mockData: [{
url: endpointUrl,
method: 'POST',
status: 200,
response: {
data: {
getSelf: {
id: 'id',
name: 'name',
email: 'email'
}
}
}
}]
};
Hi @iambumblehead ,
Did you use fetch to perform your API call in your Vue component ?
Or did you use axios ?
@ECW-HH I don't know how urql ultimately generates the request but I'll take a look now
https://github.com/FormidableLabs/urql/blob/main/packages/core/src/internal/fetchSource.ts#L26
I'm not sure where this "operation.context.fetch" is defined, but it is used to generate the urql request https://github.com/FormidableLabs/urql/blob/main/packages/core/src/internal/fetchSource.ts#L26
https://github.com/FormidableLabs/urql/blob/main/docs/api/core.md this document indicates "window.fetch" is used