-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/graphql reader #8
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lbeckman314
reviewed
Jan 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Steps Followed 🌀
1. Installing grip
✅
➜ git clone https://github.com/bmeg/grip.git
➜ cd grip
# Checking out latest branch
➜ git checkout feature/group
➜ make
➜ which grip
$HOME/go/bin/grip
➜ grip version
git commit: 20e7f63f
git branch: feature/group
git upstream: https://github.com/bmeg/grip
build date: Tue Jan 14 14:26:16 PST 2025
version: unknown
2. Installing grip-graphql
Plugins ✅
https://github.com/bmeg/grip-graphql/blob/feature/graphql-reader/Makefile
https://github.com/bmeg/grip-graphql/tree/feature/graphql-reader/gen3_writer
➜ git clone https://github.com/bmeg/grip-graphql
➜ cd grip-graphql
➜ gh pr checkout 8
branch 'feature/graphql-reader' set up to track 'origin/feature/graphql-reader'.
Switched to a new branch 'feature/graphql-reader'
# `-buildmode=plugin requires external (cgo) linking, but cgo is not enabled`
# https://stackoverflow.com/questions/61515186/when-using-cgo-enabled-is-must-and-what-happens
➜ export CGO_ENABLED=1
➜ make all
go build --buildmode=plugin ./grip-graphql-endpoint
go build --buildmode=plugin ./gen3_writer
go build --buildmode=plugin ./gql-gen
go build ./cmd/grip-graphql-proxy
# I initially failed to run this command, resulting in this error:
# `Error loading plugin writer: plugin: not implemented`
➜ go install github.com/bmeg/grip
3. Running grip
With writer
Plugin ✅
https://github.com/bmeg/grip-graphql/tree/feature/graphql-reader/gen3_writer
➜ grip server -w writer=gen3_writer.so
message Plugin gen3_writer.so loaded
4. Running grip
With writer
, reader
, and graphql
Plugins (and Tests!) ✅
➜ grip server -w writer=gen3_writer.so \
-w reader=grip-graphql-endpoint.so \
-w graphql=gql-gen.so \
-l reader:config=./config/gen3.js \
-l reader:graph=TEST \
-l writer:test=true \
-l graphql:test=true \
-l reader:test=true
message Plugin grip-graphql-endpoint.so loaded
message Plugin gql-gen.so loaded
message Plugin gen3_writer.so loaded
message Creating new pool
message Plugin added to /reader/
5. Listing Graphs ✅
➜ curl http://localhost:8201/writer/list-graphs
{"data":{},"message":"[200] list-graphs","status":200}%
Next Steps 🚀
- Load data into graphs (following the gen3_writer steps) and run sample queries 🕵️
Environment ⚙️
- Go: 1.22.5
➜ which go
/usr/local/go/bin/go
➜ go version
go version go1.22.5 darwin/arm64
- macOS: Sonoma (
14.2.1
)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR creates a gen3 integrated graphql reader endpoint for grip leveraging a FHIR based graphql schema and gqlgen golang library
Tests can be run with
then cd to tests dir and run
go test
see gql-gen/README for information on how to run in dev mode