apollo

Apollo boost - __typename in query prevent new mutation

百般思念 提交于 2019-12-24 01:36:19
问题 I have a problem in my meteor/react/apollo (with boost) project. When I query data from the server, it adds __typename to every object and subobject in my query but it my case it creates a major issue as I normally reuse these data to send them to other mutation. Now the other mutation tell me there is an error because the __typename field is not defined in my graphql schema. I tried to fix by adding the addTypename: false field to my apollo client but it didn't change anything (note I am

GraphQL how to do a JOIN request instead of many sequential request?

不问归期 提交于 2019-12-24 00:33:15
问题 I have two GraphQL type: type Author { id: String! name: String! } type Book { id: String! author: Author! name: String! } In my database, it is implemented by a foreign key inside the books table: table authors (pseudo code) `id` INTEGER UNSIGNED `name` STRING table books (pseudo code) `id` INTEGER UNSIGNED `author_id` INTEGER UNSIGNED REFERENCE `authors.id` `name` STRING So when I resolve a GraphQL query like: query allTheBooks { id name author { id name } } I would like to do only one

Authentication for GitHub API v4 with Apollo-Client

断了今生、忘了曾经 提交于 2019-12-23 23:37:16
问题 GitHub's new GraphQL API requires authentication with a token as the previous version. So, how do we add a 'Header' information into the HttpLink inside Apollo-Client ? const client = new ApolloClient({ link: new HttpLink({ uri: 'https://api.github.com/graphql' }), cache: new InMemoryCache() }); 回答1: You can define authorization header using apollo-link-context , check the header section A complete example for using apollo-client for Github API would be : import { ApolloClient } from 'apollo

解码百度Apollo智能车联开放平台,受益的不止车企

久未见 提交于 2019-12-23 18:24:46
12月18日,百度Apollo在长沙举办首届Apollo生态大会。会上,Apollo发布了点到点城市自动驾驶开放能力、自动驾驶云、新一代智能交通解决方案、小度车载2020等15大新品及解决方案。 百度Apollo“裂变” 本次生态大会,百度宣布其智能驾驶开发平台Apollo再次升级,同时还发布了之路协同、智能车联两个全新的开放平台。至此,Apollo完成“裂变”,以三大开放平台布局推动行业智能化进程。 百度智能汽车平台Apollo于2017年推出,彼时百度对外宣布:Apollo要向汽车行业及自动驾驶领域的合作伙伴提供一个开放、完整、安全的软件平台,帮助他们结合车辆和硬件系统,快速搭建一套属于自己的完整的自动驾驶系统。 经过3年发展, Apollo目前已拥有自动驾驶路测牌照数150张、智能驾驶专利数1237件、测试里程超300万公里、23个城市展开路测、全球开发者36000名、生态合作伙伴177家、开源了56万行代码。百度车联网及AI能力已覆盖60大车企,超过400款车型。 此次Apollo在“裂变”为三大开放平台的同时,其自动驾驶开放平台也再次宣布迭代。这次,百度以六大解决方案的推出,助力该平台升级到5.5版本。在这个全新版本提供的解决方案中,Robotaxi方案解决了城市开放道路的自动驾驶难题;Minibus 2.0方案让城市BRT道路的自动行驶变得更加稳妥高效

CentOS 7 搭建基于携程Apollo(阿波罗)配置中心单机模式

巧了我就是萌 提交于 2019-12-23 15:47:39
Apollo(阿波罗)是携程框架部门研发的配置管理平台,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性。服务端基于Spring Boot和Spring Cloud开发,打包后可以直接运行,不需要额外安装Tomcat等应用容器。Java客户端不依赖任何框架,能够运行于所有Java运行时环境,同时对Spring环境也有较好的支持。.Net客户端不依赖任何框架,能够运行于所有.Net运行时环境,而且已经支持.NET Core。 官网: https://github.com/ctripcorp/apollo Wiki: https://github.com/ctripcorp/apollo/wiki (一切的集成方式和使用方法都在这里) Issues: https://github.com/ctripcorp/apollo/issues (如果期间有任何问题,请通过这里查找大部分解决方法) 说明:官方提供了分布式部署方案,但是基于本地开发和调试上一般是单机部署的比较多。且提供的Quick Start方案跑不起来。所以下面将针对单机搭建上做详细的实践,用作开发环境。 注意:如果是生产环境一定要使用分布式部署方案来做高可用集群。 下载Release版本: https://github.com/ctripcorp/apollo

how to set many-to-many relation in graphql mutation?

最后都变了- 提交于 2019-12-23 10:53:20
问题 I may be missing something, but can not find any information on Apollo docs about the way to set a many-to-many relation when creating a new entry. When the relation is one-to-many it is as simple as setting the ID of the one-side of the relationship in the many-side object. But let's pretend I am working with Books and Authors, how would I write a graphql query that creates a Book for one (or many?) Authors? 回答1: This should probably happen at the API layer on the GraphQL server (i.e. schema

“Received status code 400” after apollo-server deploy to heroku

牧云@^-^@ 提交于 2019-12-23 06:47:42
问题 If I run localy npm start - everything is ok If I run git subtree push --prefix server heroku-server master - Build succeeded! When I open https://tmdb-apollo.herokuapp.com/ - "error": "Response not successful: Received status code 400" If I still do a query or mutation - it works! magic! (but I do not have autocomplete and shema sidebar on the right is always spinning) Github repo here I suspect it has something to do with my MongoDB connection setup 回答1: It's been nearly 3 days till I found

Apollo mutate calling update four times for a single mutation

旧街凉风 提交于 2019-12-23 03:51:54
问题 Every time I add a new item in my app, the mutation calls update() four times, for some reason. The first two are optimistic data, and in the second batch, one is optimistic and one is real data from the network. I can't make any sense of this. The new item being created shows up twice on the page. This is my mutation: mutation CreateTrack($name: String!, $trackNum: Int, $s3Key: String!) { createTrack(name: $name, trackNum: $trackNum, s3Key: $s3Key) { trackId name createdAt duration trackNum

GraphQL Query Runs Sucessfully One Time and Fails To Run Again using Apollo and AWS AppSync

佐手、 提交于 2019-12-23 02:44:29
问题 I'm using the basic client configuration from the example on the first page of https://github.com/awslabs/aws-mobile-appsync-sdk-js repo: const client = new AWSAppSyncClient({ url: appSyncConfig.graphqlEndpoint, region: appSyncConfig.region, auth: { type: appSyncConfig.authenticationType, apiKey: appSyncConfig.apiKey, } }); But without the <Rehydrated> component, and with a Redux <Provider> component. The highest level parent component is wrapped like this: <Provider store={store}>

GraphQL Query Runs Sucessfully One Time and Fails To Run Again using Apollo and AWS AppSync

青春壹個敷衍的年華 提交于 2019-12-23 02:44:06
问题 I'm using the basic client configuration from the example on the first page of https://github.com/awslabs/aws-mobile-appsync-sdk-js repo: const client = new AWSAppSyncClient({ url: appSyncConfig.graphqlEndpoint, region: appSyncConfig.region, auth: { type: appSyncConfig.authenticationType, apiKey: appSyncConfig.apiKey, } }); But without the <Rehydrated> component, and with a Redux <Provider> component. The highest level parent component is wrapped like this: <Provider store={store}>