Skip to content

Commit

Permalink
Generate google/protobuf GraphQL types (#4)
Browse files Browse the repository at this point in the history
* use buf to generate google type empty.proto

* attempts to get examples working

* resolve example generation

* regenerate all protobuf types
  • Loading branch information
alehechka authored Jul 29, 2022
1 parent 3850d98 commit 8773e09
Show file tree
Hide file tree
Showing 29 changed files with 834 additions and 802 deletions.
2 changes: 1 addition & 1 deletion example/greeter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
build:
protoc \
-I. \
-I../../include/graphql \
-I../../proto/grpc-graphql-gateway \
--plugin=../../dist/protoc-gen-graphql \
--go_out=:./greeter \
--go-grpc_out=./greeter \
Expand Down
2 changes: 1 addition & 1 deletion example/greeter/greeter.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

import "graphql.proto";
import "graphql/graphql.proto";

option go_package = "./;greeter";

Expand Down
47 changes: 24 additions & 23 deletions example/greeter/greeter/greeter.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/greeter/greeter/greeter_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions example/starwars/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
.PHONY: clean all

UNAME := $(shell uname)
SPECDIR := "./spec"

ifeq ($(UNAME), Darwin)
LINKCMD := ln -s $(shell brew --prefix protobuf)/include/google ./proto/google
endif
ifeq ($(UNAME), Linux)
LINKCMD := ln -s /usr/local/include/protobuf/google ./proto/google
endif

all: build

build: init
Expand All @@ -18,7 +10,8 @@ build: init
echo $$file; \
protoc \
-Iproto \
--plugin=../..//dist/protoc-gen-graphql \
-I../../proto/grpc-graphql-gateway \
--plugin=../../dist/protoc-gen-graphql \
--graphql_out=${SPECDIR} \
--graphql_opt=paths=source_relative \
--go_out=:${SPECDIR} \
Expand All @@ -31,8 +24,6 @@ build: init
init:
if [ -L "./proto/google" ]; then rm ./proto/google; fi
if [ -L "./proto/graphql" ]; then rm ./proto/graphql; fi
$(LINKCMD)
ln -s $(shell pwd)/../..//include/graphql ./proto/graphql
cd ../../ && make

start: build
Expand Down
30 changes: 30 additions & 0 deletions example/starwars/spec/starwars/starwars.graphql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions example/starwars/spec/starwars/starwars.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/starwars/spec/starwars/starwars_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8773e09

Please sign in to comment.