轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像
交易
充值流量¥7起我的订单
文档
工具
提交工单页面收录
graphql

meshtek/graphql

meshtek

下载次数: 0状态:社区镜像维护者:meshtek仓库类型:镜像最近更新:2 年前
让 AI 帮你使用轩辕镜像? · 展开查看说明 · 点击收起说明

如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。

只需在 AI 对话中先发送下面这句话即可:

请先完整阅读并严格遵守以下文档中的全部规则与要求:

https://xuanyuan.cloud/agents.md

在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。

查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

镜像简介
下载命令
镜像标签列表与下载命令
轩辕镜像,让镜像更快,让人生更轻。
点击查看

Mobidax: GraphQL installation instructions

The instructions consist of 3 sections. The first is deploying the default GraphQL server to your installation. The second is sending requests to the GraphQL server, and the third is customizing your GraphQL server by adding an additional endpoint.

Inside the example folder you will find a copy of the template files required, as well as some additional notes that will help you with installation. There is also a doc with some example requests.

Note: These instructions are not intended to be a full tutorial on how to use GraphQL, for that you will need to upskill (there are plenty of free resources on the web). This doc is intended to get you started with running the already built Mobidax GraphQL docker image on your existing installation of the Opendax stack.

Assu***ions:

  • A working installation of Opendax
  • Able to SSH into your server and access your installation of Opendax
  • We’ve used the primary installation directory name of opendax-staging (all paths mentioned in the doc will use this as the root directory name)
  • We’ve used trade.mysite.com as the example name of the installation
  • A Github or Gitlab repo hosting your installation, of which you have access
  • Working familiarity with how to use GIT source control
  • A local cloned copy of the above repo, that you can modify
  • Capability of modifying code, and using a code editor such as VC Code

Useful links:

  • https://graphql.org/
  • Why use GraphQL
  • Getting Started with GraphQL
  • GraphQL Playground

Key definitions:

  • Schema fundamentals
  • https://graphql.org/learn/thinking-in-graphs/#:~:text=the%20underlying%20process.-,With%20GraphQL%2C%20you%20model%20your%20business%20domain%20as%20a%20graph,types%20that%20reference%20other%20types.
  • https://graphql.org/learn/schema/
  • Queries and Mutations
  • Resolver

Deploying Default GraphQL image

Deploying the GraphQL image is the same as deploying any other docker container to the stack - we need a docker-compose template and a config template. For Graphql, we will create a new config template, and modify the existing gateway.yaml.erb template to include the GraphQL service, and then deploy the updated stack to your server.

  1. Open the Opendax folder (eg. opendax-staging) in your code editor, and navigate to the COMPOSE folder on the path /opendax-staging/templates/compose. You will notice existing template files, such as app.yaml.erb, backend.yaml.erb, gateway.yaml.erb, etc.
  2. Open the gateway.yaml.erb template, and below the gateway service, create the GraphQL service as follows (for your convenience, see the the ready made compose file in the example folder, pay careful attention to the tab spacing/indentation of each line)
yaml
version: '3.6'
 
services:
 gateway:
   restart: always
   image: envoyproxy/envoy:v1.10.0
   volumes:
     - ../config/gateway:/etc/envoy/
   command: /usr/local/bin/envoy -l debug -c /etc/envoy/envoy.yaml
   logging:
     driver: "json-file"
     options:
         max-size: "100m"
         max-file: "10"
 
   labels:
     - "traefik.http.routers.gateway-<%= @name %>.rule=Host(`<%= @config['app']['subdomain'] %>.<%= @config['app']['domain'] %>`) && PathPrefix(`/api`,`/admin`,`/assets/`)"
     - "traefik.enable=true"
     - "traefik.http.services.gateway-<%= @name %>.loadbalancer.server.port=8099"
     <%- if @config['ssl']['enabled'] -%>
     - "traefik.http.routers.gateway-<%= @name %>.entrypoints=websecure"
     - "traefik.http.routers.gateway-<%= @name %>.tls=true"
     - "traefik.http.routers.gateway-<%= @name %>.tls.certresolver=myresolver"
     <%- else -%>
     - "traefik.http.routers.gateway-<%= @name %>.entrypoints=web"
     <%- end -%>
 
 GraphQL:
   restart: always
   image: mobidax/core:GraphQL
   ports:
     - "4000:4000"
   volumes:
     - ../config/GraphQL/config.json:/config.json
  
   labels:
     - "traefik.http.routers.GraphQL-<%= @name %>.rule=Host(`<%= @config['app']['subdomain'] %>.<%= @config['app']['domain'] %>`) && PathPrefix(`/GraphQL`)"
     - "traefik.enable=true"
     - "traefik.http.services.GraphQL-<%= @name %>.loadbalancer.server.port=4000"
     <%- if @config['ssl']['enabled'] -%>
     - "traefik.http.routers.GraphQL-<%= @name %>.entrypoints=websecure"
     - "traefik.http.routers.GraphQL-<%= @name %>.tls=true"
     - "traefik.http.routers.GraphQL-<%= @name %>.tls.certresolver=myresolver"
     <%- else -%>
     - "traefik.http.routers.GraphQL-<%= @name %>.entrypoints=web"
     <%- end -%>
 
  1. Save the file, then navigate to the opendax-staging/template/config folder, and create a new subfolder called graphql.
  2. Copy the template config.json.erb from the example folder into the above subfolder.
  3. Next, open the opendax-staging/templates/config/gateway/envoy.yaml.erb file
  4. Under the routes section, add a new route for GraphQL as follows (pay close attention to the tab spacing / indentation, ensuring that this route indentation is consistent with the other routes):
yaml
            routes:
             - match:
                 prefix: "/api/myapp"
               route:
                 cluster: myapp
                 prefix_rewrite: "/api"
             - match:
                 prefix: "/api/v2/admin/GraphQL"
               route:
                 cluster: GraphQL
                 prefix_rewrite: "/GraphQL"

  1. Next, under the Clusters section in the same file (towards the bottom) add a new cluster for GraphQL (again paying strict attention to the tab spacing / indentation of the other clusters and ensure the GraphQL cluster has consistent tab***g to the other clusters),
    - name: GraphQL
        connect_timeout: 5.000s
        type: strict_dns
        lb_policy: round_robin
        hosts:
        - socket_address:
            address: GraphQL
            port_value: 4000

At this point, GraphQL should be configured correctly to be able to be reached by external requests. Next deploy these changes to your installation:

  1. Save, commit, and push these changes to your installation:

    1. git add .
    2. git commit -m “feat: deploy GraphQL”
    3. git push
  2. Next we’ll confirm that the changes are reflecting on your server.

    1. SSH into your machine
    2. From your opendax-staging folder, pull the latest updates and render them (if you have runners set up, this would likely already have been done for you)
      • git pull
      • rake render:config
    3. Pull the docker image:
      • docker pull mobidax/core:GraphQL
    4. Restart the Gateway service, which will start the newly added GraphQL service
      • docker-compose up -Vd gateway
    5. Check that GraphQL is running:
      • docker ps | grep GraphQL
      • Visit the GraphQL playground which should now be reachable:
        1. trade.mysite.com/graphql
  3. You should now have the GraphQL server running on your server, and it should be accessible via external API calls. In the next section we will run some commands to test that everything is working as expected.

Interacting with GraphQL

In this section we will interact with GraphQL, introducing the basic concept of how to interact, and send some test commands. GraphQL is a vast tool, and to use it correctly you will need to upskill on how to formulate commands and what the expected usage of it is. This is a primer only!

GraphQL is fundamentally made up of 2 types of requests. Queries and Mutations. Think of queries as GET requests, and mutations as POST / DELETE / PUT requests. In other words, any request that intends to change (ie. ‘mutate’) data will be done via a Mutation. Any request that intends to only retrieve data without making changes (ie. ‘query’) is done via a Query. (This is a loose distinction between the two, there may be cases when the definitions overlap.)

If you are requesting private endpoints that require authentication, authentication will need to be provided in the request. Public endpoints as expected do not require authentication.

GraphQL works well for mobile applications, because you can specify exactly which data you want returned from that endpoint instead of returning the entire payload that might be available. For example, if you were to query the Markets endpoint using a classic RESTful API call, you would get back the name, id, state, base_currency, quote_currency, min_price, max_price etc etc the full complement of data that that endpoint provides.

But let's say for example you have a screen in your app that needs only the market ID, name, and state. With REST you are forced to pull all the fields from the endpoint, and then only use 3 of them. A complete waste of bandwidth, time, server resources, and ultimately money. With GraphQL, you are able to specify the fields up front in your request that you want, and only those fields are returned. Great.

Lets try this out on the Market endpoint:

Public endpoints (no authentication required)

First, visit the GraphQL playground at your site: trade.mysite.com/GraphQL

The left panel is where you input your requests, and the right is where you see the results. The play button in the middle executes the request.

Enter the following command in the left panel to get a list of markets, with their name, id and state, then hit the play button in the center to execute the command:

graphql
{
  markets
  {
    name
    id
    state
  }
}

As you can see the data is returned in a nicely formatted JSON object that your app can interpret as needed.

Let's now also get the base and quote currencies:

graphql
{
  markets
  {
    name
    id
    state
    base_currency
    quote_currency
  }
}

Running the request with additional fields will see the currencies returned too.

If you click on the docs tab on the right next to the results you will be able to see the entire schema (all the fields) that are available to be queried. This is the GraphQL equivalent to the regular REST API documentation. One nice additional benefit of GraphQL is that any additional endpoints / changes you make to the server will automatically update in this schema, so you don’t have to worry about manually adding documentation for any changes that you make to the server.

Try experimenting with the other public endpoints, such as:

  • currencies
  • trades
  • depth

##Private endpoints (Authentication is required)

Private endpoints require authentication, in other words the user needs to have an active Barong session, and have that Barong session token at hand (default name is: _barong_session).

Lets log in and get the _barong_session token:

To login, we will be using a Mutation, as opposed to the Query we used on the public endpoint.

graphql
mutation{
  login(email: "admin@mysite.com",
        password:"changeme",
        otp_code: "123456")
  {
   _barong_session 
  }
}

Notice how we specify the _barong_session as the field we want returned to us.

Running the command will create a new session in Barong, and will return the token. This token will expire at some point, as per the Barong config.

We can now request private data by passing this auth token along with the requests, as well as specifying a parameter - in this case we want to get the BTC beneficiaries, so we pass currency: “btc” as the parameter, and the _barong_session token. Similar to a Query, we provide the fields we want returned, in this case id, currency, name, and state.

graphql
{
  getBeneficiaries(_barong_session:"3b3922a05e5e5dc37aee1568e6239167",
  currency: "btc")
{
              id
    	  currency
  name
    	  state
  	}
}

The admin user will get returned a list of their beneficiaries.

Try running commands for the following endpoints:

  • userOrders
  • userTrades
  • balances

At this point, you should now be ready to begin developing your mobile app, or migrating your existing app to using GraphQL instead of the original Peatio / Barong REST API and gaining the performance benefits of GraphQL.

Modifying GraphQL

This section deals with adding your own endpoints to GraphQL. For our example we will add an endpoint that hits the database and retrieves bank deposit details for the specified currency. Reminder: this doc is not intended to be a tutorial on the best development practices or techniques, but a bootstrap to get you started with GraphQL on Opendax. Be warned, adding methods and modules directly to the GraphQL server that exposes your database comes with hopefully obvious risks, and should be managed and secured correctly. Always secure your endpoints, and manage the *** vectors. You have been warned!

Custom GraphQL endpoint

Each custom endpoint should follow the pattern outlined below. Each folder that we create will contain 1x resolver.js and 1x schema.js file, within which we will describe all the endpoints that make sense for that folder category - again your architecture is up to you.

  • 001-bank-details (folder)
    • resolver.js (file)
    • schema.js (file)
  • 002-onfido-kyc (folder)
    • resolver.js (file)
    • schema.js (file)

Before adding the endpoint to GraphQL, let's create a new table in our database, populate it with bank deposit details, and then we can query this table using GraphQL.

Lets create a new table in your database, we’ll call it bank_deposit_details (you can add this table to a new DB schema, or simply add it to the Peatio DB by creating a migration etc - that is beyond the scope of this doc). Create the following columns for the table:

  • currency_id
  • bank_name
  • account_number
  • account_name
  • swift_code
  • status
  • created_at
  • updated_at

Insert some data to create 2x records one for usd and one for eur as your currency_id’s.

Now that the table is set up, lets create the GraphQL endpoint that will access this table:

  1. Open the GraphQL folder in your editor eg. VS Code

  2. Create a new subfolder under the folder /server/custom/ called gql

  3. Inside the gql folder, create a subfolder called 001-get-bank-details

  4. Inside the 001-get-bank-details folder create a new file called resolver.js

  5. Inside the 001-get-bank-details folder create a new file called schema.js

  6. Copy and save the code from the example resolver.js file from the downloaded GraphQL folder in the subfolder named Bank Details Endpoint into the resolver.js file you just created.

  7. Similarly, copy and save the code from the example schema.js file from the downloaded GraphQL folder in the subfolder named Bank Details Endpoint into the schema.js file you just created.

  8. Notice that the resolver returns a JSON containing all the columns of the table. To optimize this query even further, and use the full power of GraphQL you could rewrite the Sequelize query to retrieve only the columns requested in the GraphQL Query that was submitted, eg. if only the bank name is requested, then only select the bank name from the DB instead of selecting all.

  9. Take a look at the schema.js. Inside here we specify 2x types.

    1. This first is the ‘model’ of the Query. In this instance it is the BankDepositDetails type, with the list of fields available.

    2. The second is the definition of the Query itself, here we give it a name (this is the name of the endpoint), and we also specify the parameters that are expected / required for the endpoint.

  10. Now that we’ve added our custom endpoint, all that is left is to restart the GraphQL server, and we should then be able to query that endpoint.

    1. Restart GraphQL:
      • docker-compose up -Vd GraphQL
  11. Once the server is restarted, refresh the GraphQL playground page trade.mysite.com/graphql and look for the new getBankDepositDetails endpoint in the docs or schema definitions on the right panel. If everything was done correctly, you should see the new getBankDepositDetails endpoint and the type it returns.

  12. Try query the endpoint:

graphql
{
  getBankDepositDetails(currency:"usd")
  {
    bankName
    currencyId
    accountName
  }
}

This should be enough to get you started with GraphQL, you can experiment further with adding your own authenticated endpoints (use the existing resolvers as examples located at /server/src/resolvers.js)

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 graphql 镜像标签

docker pull docker.xuanyuan.run/meshtek/graphql:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull meshtek/graphql:<标签>

轩辕镜像配置手册

按平台快速找到配置文档

一键安装

一键安装 Docker

Linux Docker 一键安装

AI

用 AI 使用轩辕镜像

agents.md · AI 对话 · 提示词

Docker

登录仓库拉取

登录认证 · 私有仓库

专属域名拉取

免登录 · 高速拉取

Linux

Docker 镜像配置

Windows / Mac

Docker Desktop 配置

MacOS OrbStack

OrbStack 容器

Apple Container

macOS 原生容器

Docker Compose

Compose 项目配置

NAS

群晖

Synology 配置

飞牛

fnOS 镜像配置

绿联

绿联 NAS

威联通

QNAP 配置

极空间

极空间 NAS

Unraid

Unraid NAS

企业仓库

其他仓库

ghcr · Quay · nvcr

Harbor 镜像源

Proxy Repository 对接

Portainer 镜像源

Registries 配置

Nexus 镜像源

Docker Proxy 缓存

开发工具

Dev Containers

VS Code 开发容器

Podman

Podman 配置指南

Singularity / Apptainer

HPC 科学计算容器

Kubernetes

K8s Containerd

Kubernetes · Containerd

K3s

轻量级集群

面板 / 网络

爱快路由

iKuai 镜像加速

宝塔面板

一键配置镜像源

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

功能

版本功能对比

功能对比 · 版本选择

支持的镜像仓库

Docker Hub · GCR · GHCR

新手拉取配置

登录 · 专属域名 · 配置

docker search 限制

专属域名 · Hub 搜索

不支持 push

仅支持 pull · 不支持

拉取速度原因

带宽 · 缓存 · 冷热镜像

错误码

402 与流量用尽

402 · 流量包 · 充值

401 认证失败

401 · docker login

manifest unknown

标签错误 · 镜像不存在

410 Gone 排查

410 · Docker 升级

429 限流

免费版 · 专业版 · 企业版 · 请求频率

其他报错

DNS 超时

DNS 解析 · 网络超时

TLS 证书失败

no matching manifest(架构)

账号

失败是否计费

manifest · blob · 计费

申请开发票(企业 / 个人)

企业 · 个人 · 工单

修改登录密码

网站 · 仓库 · 重置

注销账户

工单 · 数据 · 注销

原理

mirrors 不生效

daemon.json · 重启

去掉域名前缀

docker tag · 重命名

指定架构拉取

ARM64 · AMD64 · 多架构

latest 与「最新」

digest · 版本号 · 标签

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
meshtek/graphql
教程轩辕镜像功能与使用教程
定价查看流量套餐与价格
热门查看热门 Docker 镜像推荐
博客Docker 镜像公告与技术博客
专业版 · 高速稳定拉取镜像
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
50GB 仅 ¥7/年
专业版 · 高速稳定拉取镜像
50GB 仅 ¥7/年
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
用户协议·隐私政策·增值电信业务经营许可证:浙B2-20261007·©2024-2026 源码跳动©2024-2026 杭州源码跳动科技有限公司·商务合作:点击复制邮箱

更多 graphql 镜像推荐

demisto/graphql logo

demisto/graphql

demisto
暂无描述
10万+ 次下载
21 天前更新
graphql/voyager logo

graphql/voyager

graphql
GraphQL Voyager的Docker封装镜像,用于可视化展示GraphQL API的结构与关系,帮助开发者直观理解和分析API架构。
2 次收藏10万+ 次下载
5 年前更新
graphql/gateway logo

graphql/gateway

graphql
一个简单可扩展的GraphQL网关镜像,基于Apollo Federation,支持Docker部署、自动更新Schema、连接Graph Manager及AWS Lambda函数调用等功能。
4 次收藏1万+ 次下载
5 年前更新
graphql/event-store logo

graphql/event-store

graphql
EventStore with GraphQL api
968 次下载
7 年前更新
graphql/auth logo

graphql/auth

graphql
基于graphql-credentials的授权服务,提供GraphQL接口的身份验证与权限管理功能
722 次下载
7 年前更新
storyscript/graphql logo

storyscript/graphql

storyscript
暂无描述
100万+ 次下载
5 年前更新

查看更多 graphql 相关镜像