New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetch data from rest does not initialized data supbprop #71
Comments
Hi @Simply007! I took a look at your API and example app. And I think you're missing a couple details in there. You probably want to pass Because you have a deeply nested object structure, you may also want to take a look at apollo-link-rest/src/restLink.ts Lines 91 to 98 in 75df172
Cheers! |
OK, if i get it right, you need to specify the format of the data you get from the rest. To do that, it is required to set up TypePatcherTable to know the type "MyType" and then to the rest definition set this type. Do you have any example, how to define the type using TypePatcherTable? Ideally with the type nesting. |
Look for typePatcher in tests/restLink.ts, we have a complex nested example in there. (I’m on my phone or I would give you a deep link to there, sorry!) |
apollo-link-rest/src/__tests__/restLink.ts Lines 377 to 559 in 76a0e47
@Simply007 -- this is a complex example showing all the different ways you could set up typePatcher
|
Great, this is exactly what I need! :-) |
Hello, I have tried to fetch some data from REST end point:
deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/items/
I was able to set up the query and fetch the data (seeing the request when sniffing network):
https://github.com/Simply007/apollo-link-rest/tree/master/examples/apollo2
But when I am about to render the actual content, I do not have initialized the data:
https://github.com/Simply007/apollo-link-rest/blob/master/examples/apollo2/src/Components/Article.js#L26
Do you have an hint how to fix that.
I am also getting an error in console:
To run the example, just go the /examples/apollo2 and run:
npm install
npm run
Example is based on create-react-app script.
The text was updated successfully, but these errors were encountered: