apollo-client

React Uncaught Invariant Violation: Could not find “client” in the context of ApolloConsumer. Wrap the root component in an <ApolloProvider>

佐手、 提交于 2021-02-10 08:31:50
问题 I have a React app using react-apollo:2.5.8 and a library of custom components that I install via NPM and use within the app. The library has react-apollo:2.5.8 listed in peer and dev dependencies. Ever since I upgraded react-apollo to 2.5.8 I have been getting this error `Uncaught Invariant Violation: Could not find "client" in the context of ApolloConsumer. Wrap the root component in an <ApolloProvider>.` I tried listing React-apollo within externals in the Webpack build for the library as

ApolloClient from apollo-boost attemped to assign to readonly property

主宰稳场 提交于 2021-02-10 03:09:07
问题 I'm working with react-native, and trying to load Apollo from apollo-boost. When I attempt to import the client, I get the error message "Attempted to assign to readonly property." I'm not sure how to work around this, and it seems from the stack trace that it's in the apollo-boost package. Anybody know how I can work around this? edit: Adding picture and details. I'm getting this when I try to load the app through Expo. Right when it starts, I get this. The first file in my app the stack

ApolloClient from apollo-boost attemped to assign to readonly property

六眼飞鱼酱① 提交于 2021-02-10 03:09:00
问题 I'm working with react-native, and trying to load Apollo from apollo-boost. When I attempt to import the client, I get the error message "Attempted to assign to readonly property." I'm not sure how to work around this, and it seems from the stack trace that it's in the apollo-boost package. Anybody know how I can work around this? edit: Adding picture and details. I'm getting this when I try to load the app through Expo. Right when it starts, I get this. The first file in my app the stack

ApolloClient from apollo-boost attemped to assign to readonly property

非 Y 不嫁゛ 提交于 2021-02-10 03:07:32
问题 I'm working with react-native, and trying to load Apollo from apollo-boost. When I attempt to import the client, I get the error message "Attempted to assign to readonly property." I'm not sure how to work around this, and it seems from the stack trace that it's in the apollo-boost package. Anybody know how I can work around this? edit: Adding picture and details. I'm getting this when I try to load the app through Expo. Right when it starts, I get this. The first file in my app the stack

Best practice for Next.js data fetching inside a component

拈花ヽ惹草 提交于 2021-02-08 14:53:12
问题 I have a menu component that appears globally. What is the best practice for getting data into that component? I'm trying to take advantage of static generation that Next.js offers but all data fetching guidance from the Next.js team relates to pages. getStaticProps and getStaticPaths seem to pertain to page generation, not data for components. Is their SWR package the right answer, or Apollo Client? Typically in hooks-based React, I'd just put my data call into useEffect . I'm not sure how

How to force Apollo Client to use cached data

谁都会走 提交于 2021-02-08 07:52:37
问题 We have an application that initially load a list of widgets: query Widgets() { widgets() { ...Widgets } } fragment Widgets on Widgets { name description rootWidget widgets { ...WidgetInterface } } fragment WidgetInterface on WidgetInterface { id name description type } later on I render this widgets, where every react component is wrapped with another graphql call to get the data for a single widget. As we fetch this data initially I would expect apollo get the data from local store, but it

How to generate java client using Apollo GraphQL?

纵然是瞬间 提交于 2021-02-07 10:58:28
问题 I have tried steps mentioned in the official doc but it showing Error: Unsupported target: java In CLI help, java is not listed as a target 回答1: Server setup Spring Boot with GraphQL Server: https://www.graphql-java.com/tutorials/getting-started-with-spring-boot/ Full working GraphQL server code exist on GitHub: https://github.com/graphql-java/tutorials/tree/master/book-details Client Generate GraphQL Query Code from schema Create Java Project with the following build.gradle buildscript {

Files bigger than 16 kb gets corrupted when uploaded, using apollo and graphql

丶灬走出姿态 提交于 2021-01-29 20:11:35
问题 Think i tried everything, but nothing seems to work. I have a React app, and i want to upload pictures to a folder. I am using Apollo server and Graphql. The weird thing is that if the file is less than 17 kb, it works!. But anything bigger than that, the file gets corrupted. I can see the image file in the folder but it is 0kb, and when i try to open it it says that the image contains errors". I don't have a limit to size of items. The resolver: I tried using a different method of doing this

How to consume GraphQL API from Nativescript Core application?

跟風遠走 提交于 2021-01-29 03:21:28
问题 I am trying to consume GraphQL ApI from nativescript core application but whole docs and tutorials are around nativescript angular and apollo. Is it possible?, any recommendations about how to start? 回答1: It works fine with apolli-client as @Manoj recommended 来源: https://stackoverflow.com/questions/57237305/how-to-consume-graphql-api-from-nativescript-core-application

Question about parent/child relationships and components

我是研究僧i 提交于 2021-01-28 14:10:26
问题 I'm currently trying to port a project from vuex/REST to vue-apollo. The project shows a list of events, and each event can be expanded to show details, including attendees. So I'm having an EventList component, that fetches the events and all attributes necessary for the list. And I have a EventDetails child component that is expanded from the list onclick. EventDetails requires some event data as well as the list of attendees to render. Problem is, I cannot find an elegant way to build the