Skip to content

takeruun/go-elastice-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go ElasticSearch on hasura

go で ElasticSearch を使い、hasura 経由でデータ検索するサンプルです。

立ち上げ

使い方

query searchItem を叩く。

例:

query {
  searchItems(where: {title: "title"}) {
    id
    server_item {
      title
    }
  }
}

hasura → go server → hasura の順で実行している。

方法

  1. remote-schema(go server)で定義したクエリsearchItemsを hasura で読み込ませる。

  2. remote-schema(go server)type Item と DB の itemsテーブルを紐付ける。

screencapture-localhost-9695-console-remote-schemas-manage-server-schema-relationships-2023-10-07-16_54_04

  1. 紐付け定義したものをremote-schema(go server)で定義したクエリで使う。
スクリーンショット 2023-10-07 16 54 57