apollo

Using GraphQL Fragment on multiple types

只谈情不闲聊 提交于 2019-11-28 07:07:22
问题 If I have a set of field that is common to multiple types in my GraphQL schema, is there a way to do something like this? type Address { line1: String city: String state: String zip: String } fragment NameAndAddress on Person, Business { name: String address: Address } type Business { ...NameAndAddress hours: String } type Customer { ...NameAndAddress customerSince: Date } 回答1: Fragments are only used on the client-side when making requests -- they can't be used inside your schema. GraphQL

Apollo 5.0 障碍物行为预测技术

徘徊边缘 提交于 2019-11-28 03:17:20
障碍物行为预测是无人驾驶系统的核心模块之一。预测模块承接上游感知模块,结合高精地图和主车的定位信息,对周边障碍物的未来运动情况进行预测,帮助主车提前作出决策,从而降低交通事故的发生率,在无人驾驶系统中发挥着承上启下的关键作用。 在百度 Apollo 自动驾驶开源平台中,障碍物行为预测分为车辆轨迹预测和行人轨迹预测两大类。在车辆轨迹预测中,分为意图预测和速度预测两个过程。意图预测根据不同的场景,通过深度学习神经网络给出各行为意图的概率。速度预测考虑与主车的交互,运用采样+代价函数选择的方法,给出合理的速度预测。 在本篇分享中,我们有请 Apollo 资深研发工程师许珂诚为大家分享在百度 Apollo 平台上,障碍物行为预测的技术方案。 Apollo 预测模块概述 预测模块承接感知、定位、地图模块,通过预测算法,可以给出障碍物未来的运动轨迹,输出给下游规划模块。 Apollo 预测模块意义 来源: https://www.cnblogs.com/liuzubing/p/11388485.html

Are mutation methods required to be on the top level?

元气小坏坏 提交于 2019-11-27 05:22:25
All docs and tutorials usually show simple examples of mutations that look like this: extend type Mutation { edit(postId: String): String } But this way the edit method has to be unique across all entities, which to me seems like not a very robust way to write things. I would like to describe mutation similar to how we describe Queries, something like this: type PostMutation { edit(postId: String): String } extend type Mutation { post: PostMutation } This seems to be a valid schema (it compiles and I can see it reflected in the generated graph-i-ql docs). But I can't find a way to make

How to know which fields were requested in a GraphQL query?

寵の児 提交于 2019-11-27 04:53:40
问题 I have written a GraphQL query which like the one below: { posts { author { comments } comments } } I want to know how can I get the details about the requested child fields inside the posts resolver. I want to do it to avoid nested calls of resolvers. I am using ApolloServer's DataSource API. I can change the API server to get all the data at once. I am using ApolloServer 2.0 and any other ways of avoiding nested calls are also welcome. 回答1: You'll need to parse the info object that's passed

linux下搭建阿波罗分布式配置中心

梦想的初衷 提交于 2019-11-27 03:50:37
1 环境要求 首先虚拟机内存在2g以上 一定要提前安装好java1.8k环境。 安装jdk步骤如下: 1、在user目录下新建java文件夹: # cd /usr/ # mkdir java # cd java 2.下载jdk1.8,进入http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html,复制下载目录 # wget http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux- x64.tar.gz? AuthParam=1534129356_6b3ac55c6a38ba5a54c912855deb6a22 3、解压:使用tar -zxvf 文件名进行解压。解压之后: 4、配置环境变量: # vi /etc/profile 将如下配置添加至文件中,然后保存退出。 #java export JAVA_HOME=/usr/java/jdk1.8.0_181 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib

Apollo / GraphQl - Type must be Input type

做~自己de王妃 提交于 2019-11-26 21:06:18
Reaching to you all as I am in the learning process and integration of Apollo and graphQL into one of my projects. So far it goes ok but now I am trying to have some mutations and I am struggling with the Input type and Query type. I feel like it's way more complicated than it should be and therefore I am looking for advice on how I should manage my situation. Examples I found online are always with very basic Schemas but the reality is always more complex as my Schema is quite big and look as follow (I'll copy just a part): type Calculation { _id: String! userId: String! data: CalculationData

Center OS 7安装 Apollo

做~自己de王妃 提交于 2019-11-26 20:22:25
声明: 每个人的情况都不一样,所以大家在看教程的时候自行斟酌,最好先扫一遍,再来根据自身情况进行操作。同时,遇到的问题也可能不尽相同,要灵活处理。 了解: Apollo是从原始ActiveMQ的基础构建一个新的更快的,更可靠的,使用完全不同的线程和消息调度架构来实现的。 Apollo是一个多协议的代理,支持MQTT,WebSockets等等。 MQTT服务器其实相当于一个转发者的角色,也相当于一个公众平台,所有客户端连接到此平台进行消息主题的发布及订阅。服务器其实是一个消息中转站 一、 安装Java JDK: 1、 查看自己系统位数。 输命令 getconf LONG_BIT ,会返回系统位数 2、查看jdk是否安装。 由于搭建 Apollo 环境变量需要有 JAVA_HOME,这个时候需要确认下系统中是否已经安装有jdk。确认办法为输入命令:java -version (我的未安装) 3、 下载JDK -- 下载Linux x64版本压java jdk缩包,注意是tar.gz后缀名。 4、 创建java目录 -- 在/usr/local/中创建java目录 -- 将下载好的jdk压缩包通过ftp上传至Center OS的java目录中 5、 配置环境 -- 进入java路径下 -- 解压到当前目录 tar –zxvf jdk-8u221-linux-x64.tar.gz --

Apollo/GraphQL field type for object with dynamic keys

我只是一个虾纸丫 提交于 2019-11-26 16:44:27
问题 Let's say my graphql server wants to fetch the following data as JSON where person3 and person5 are some id's: "persons": { "person3": { "id": "person3", "name": "Mike" }, "person5": { "id": "person5", "name": "Lisa" } } Question : How to create the schema type definition with apollo? The keys person3 and person5 here are dynamically generated depending on my query (i.e. the area used in the query). So at another time I might get person1 , person2 , person3 returned. As you see persons is not

How to chain two GraphQL queries in sequence using Apollo Client

£可爱£侵袭症+ 提交于 2019-11-26 14:00:10
问题 I am using Apollo Client for the frontend and Graphcool for the backend. There are two queries firstQuery and secondQuery that I want them to be called in sequence when the page opens. Here is the sample code (the definition of TestPage component is not listed here): export default compose( graphql(firstQuery, { name: 'firstQuery' }), graphql(secondQuery, { name: 'secondQuery' , options: (ownProps) => ({ variables: { var1: *getValueFromFirstQuery* } }) }) )(withRouter(TestPage)) I need to get

Are mutation methods required to be on the top level?

人走茶凉 提交于 2019-11-26 11:34:08
问题 All docs and tutorials usually show simple examples of mutations that look like this: extend type Mutation { edit(postId: String): String } But this way the edit method has to be unique across all entities, which to me seems like not a very robust way to write things. I would like to describe mutation similar to how we describe Queries, something like this: type PostMutation { edit(postId: String): String } extend type Mutation { post: PostMutation } This seems to be a valid schema (it