# apollo graphql **Repository Path**: cat-lin/apollo-graphql ## Basic Information - **Project Name**: apollo graphql - **Description**: Apollo GraphQL演示代码 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-04-04 - **Last Updated**: 2023-04-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Apollo GraphQL 网关,Node.js GraphQL Server及Python GraphQL Server代码演示 ## 项目介绍 本项目通过Apollo GraphQl gateway 作为网关层,分发请求到Node.js GraphQL Server和Python GraphQL Server. ## 基础环境搭建 * windows * python3.9 * git * node.js v16.17.0 * pycharm 2022 ## 运行步骤 步骤一 拉取代码 > git clone https://gitee.com/cat-lin/apollo-graphql.git > 步骤二 通过pycharm打开项目根目录 ![](./image4md/pycharm.png) 步骤三 安装python第三方依赖 > pip install -r .\graphql-python-server\requirements.txt > ![](./image4md/pip.png) 步骤四 安装node.js第三方依赖 > npm install > ![](./image4md/npm.png) 步骤五 运行Python GraphQL Server ![](./image4md/pythonServer.png) 步骤六 运行Node.js GraphQL Server > cd graphql-nodejs-server > node user-server.js > ![](./image4md/nodeServer.png) 步骤七 运行GraphQl Gateway > cd graphql-gateway > node gateway.js > ![](./image4md/apolloGateway.png) 步骤八 通过浏览器访问 ![](./image4md/test.png) 步骤九 测试功能 查询语句 ``` query ExampleQuery($email: ID!) { test(email: $email) { email name totalProductsCreated } getProducts { id name price } } ``` 参数 ```json { "email": "info@converse.com" } ``` ![](./image4md/test1.png)