Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Using MockedProvider results in error "No more mocked responses for the query: ..." #617

@tkiethanom

Description

@tkiethanom

I'm not sure why this happens, it seems I need to set up some MockedResponses but I don't know how to do that. When I console.log _this.mockedResponsesByKey and key in MockNetworkInterface.prototype.query it looks like the keys don't match because one is a string and the other is an object. I could be reading this wrong though.

Steps to Reproduce

Mount a MockedProvider using enzyme.

const query = addTypenameToDocument(myQuery);

const mounted = mount(
	<MockedProvider mocks={[
		{
			request: { query, variables },
			result: { data: mockedData },
		}
	]}>
		<ConnectedComponent { ... routerParams } store={store} />
	</MockedProvider>
);

Buggy Behavior

The component receives No more mocked responses for the query: ... in this.props.data.error

Expected Behavior

Should not throw an error

Version

  • apollo-client@1.0.1
  • react-apollo@0.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions