apollo

Apollo client doesn't display an error message

梦想与她 提交于 2021-01-27 17:42:30
问题 I have configured and set up a fully functional express-nextjs-graphql-apollo app that can login/logout a user, and perfectly do CRUD. The last and very important step is to display error messages on client-side. So far, I'm only getting this red error in a console: POST http://localhost:3000/graphql 500 (Internal Server Error) For example, a login form validation. When no input is provided, it's supposed to get an invalid input error message, or E-Mail is invalid if email format is incorrect

When to use Apollo's cacheRedirects?

倾然丶 夕夏残阳落幕 提交于 2021-01-27 05:40:49
问题 The Apollo documentation discusses the use of cacheRedirects to tell Apollo how to access data that's already in the cache from other query. It gives an example of this: In some cases, a query requests data that already exists in the client store under a different key. A very common example of this is when your UI has a list view and a detail view that both use the same data. The list view might run the following query: query ListView { books { id title abstract } } When a specific book is

When to use Apollo's cacheRedirects?

泪湿孤枕 提交于 2021-01-27 05:39:40
问题 The Apollo documentation discusses the use of cacheRedirects to tell Apollo how to access data that's already in the cache from other query. It gives an example of this: In some cases, a query requests data that already exists in the client store under a different key. A very common example of this is when your UI has a list view and a detail view that both use the same data. The list view might run the following query: query ListView { books { id title abstract } } When a specific book is

How to fix initialization error for DefaultKotlinSourceSetKt?

谁都会走 提交于 2021-01-27 05:36:28
问题 With project build (or simple Gradle sync), I have the following error: Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt This error shows after change gradle wrapper version from 4.10 to 6.2.2 (because min gradle wrapper version required 5.6.4, but with 5.6.4 Apollo has error "Access denied" for build folder) Sorry for mistakes, my English is very bad( My build.gradle: apply plugin: 'com.android

看懂2020年智能浪潮,我们从百度和谷歌的AI足迹出发

ぃ、小莉子 提交于 2021-01-23 09:35:56
来源: 脑极体 2020年已经过去,无论我们过得顺遂平安,还是过得无比艰难,我们应该都会记住这一年。 回顾2020年,在这个不同寻常的疫情之年,科技成为人类抗击疫情的关键,而人工智能技术投入抗疫战争之中,可以说是人类有史以来的第一次。而与此同时,AI技术已经在我们的生产生活、公共管理等方方面面得到深入应用。 人工智能应用场景的爆发,其背后是全球AI科技企业从后端走向前台,从实验室走向产业纵深的努力和实践。 最近,百度和谷歌不约而同都发发布了长文,来总结2020的AI发展。 谷歌首席AI科学家Jeff Dean在谷歌博客上刊出了Google Research: Looking Back at 2020, and Forward to 2021的万字长文,详细介绍了谷歌在2020年AI技术在多个领域取得的应用进展。 而更早一点时间,百度先后发布了长达万字的《百度AI的2020》和《百度研究院2021年十大科技趋势预测》,同样细数了百度过去一年里在AI技术业务体系和产业赋能体系中的各项成果,同时也对2021年的AI技术和应用领域做出清晰判断。 如果仔细对比谷歌和百度在AI技术和产业应用的实践,我们就会惊讶地发现,两家几乎同时以搜索引擎业务起家的公司已经将AI技术应用到自身产品体系的方方面面。 我们同时也看到,谷歌和百度正在构建一幅千行百业智能化的全球AI图景,不过两家巨头的不同之处在于

GraphQL: how can I throw a warning after a successful mutation?

早过忘川 提交于 2021-01-22 03:19:44
问题 Let's imagine I have a createPost mutation that inserts a new post. In a typical app, that mutation can either: Succeed, returning a Post . Fail, throwing an error (I use apollo-errors to handle this). What I'd like to implement is a middle scenario, where the mutation succeeds (returning a Post ); but also somehow returns a warning to the user (e.g. Your post is similar to post XYZ or similar). What would be a good GraphQL pattern to implement this? Adding a warning field to the Post type

GraphQL: how can I throw a warning after a successful mutation?

筅森魡賤 提交于 2021-01-22 03:19:17
问题 Let's imagine I have a createPost mutation that inserts a new post. In a typical app, that mutation can either: Succeed, returning a Post . Fail, throwing an error (I use apollo-errors to handle this). What I'd like to implement is a middle scenario, where the mutation succeeds (returning a Post ); but also somehow returns a warning to the user (e.g. Your post is similar to post XYZ or similar). What would be a good GraphQL pattern to implement this? Adding a warning field to the Post type

GraphQL: how can I throw a warning after a successful mutation?

风流意气都作罢 提交于 2021-01-22 03:19:12
问题 Let's imagine I have a createPost mutation that inserts a new post. In a typical app, that mutation can either: Succeed, returning a Post . Fail, throwing an error (I use apollo-errors to handle this). What I'd like to implement is a middle scenario, where the mutation succeeds (returning a Post ); but also somehow returns a warning to the user (e.g. Your post is similar to post XYZ or similar). What would be a good GraphQL pattern to implement this? Adding a warning field to the Post type

GraphQL : the object name is defined in resolvers, but not in schema

大城市里の小女人 提交于 2021-01-21 06:47:41
问题 I want to define a mutation using graphql. My mutation is getting an object as argument. So I defined the new Object in the schema and in the resolver using GraphQLObjectType. However I m getting this error : Error: Agreement.name defined in resolvers, but not in schema Any idea ? Here is my Schema definition const typeDefs = ` type Agreement { id: Int } type Mutation { agreementsPost(agreement: Agreement) : String } `; And Here is my resolver : const appResolvers = { Agreement: new

Add an array of Objects to a mutation in apollo-react

别等时光非礼了梦想. 提交于 2021-01-21 04:14:39
问题 I am using react-apollo on the front-end and graphcool on the backend. I have a mutation that creates a tutorial like so: const CREATE_TUTORIAL_MUTATION = gql` mutation CreateTutorialMutation( $author: String $link: String $title: String! $postedById: ID! $completed: Boolean! ) { createTutorial( author: $author link: $link title: $title postedById: $postedById completed: $completed ) { author link title postedBy { id name } completed } } ` It gets called in a submit handler like so... this