Skip to content

Commit

Permalink
add alternative implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
korzio committed Aug 25, 2023
1 parent 1539da3 commit 3e69c05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ graph TB
- https://medium.com/xanthous/translating-grpc-services-into-graphql-6a8e49556d96
- https://docs.google.com/presentation/d/11sw3yK7p6xYcES9Wsjco7z3lGgmYlefnNrqhZ6vaYvA/edit#slide=id.g4c78b68687_0_93

- https://github.com/emzeq/proto2graphql
- https://github.com/whale-labs/proto-converter

### [GraphQL](./graphql.md)

### Gateways
Expand Down
9 changes: 4 additions & 5 deletions protoc-gen-graphql/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ async function generateFile() {
const schemaFile = new CodeGeneratorResponse.File();
schemaFile.setName(`${parse(protoFile.getName()).name}.gql`);

const root = await protobuf.load(protoFile.getName())
// Obtain a message type
// console.log(root);
// const Book = root.lookupType("books.Book");
// fs.writeFileSync('debug.log', Book.toString())
const root = await protobuf.load(protoFile.getName());
debugContent = `${debugContent}\nnested: ${JSON.stringify(
root.nestedArray
)}`;

fileContent = `${fileContent}\n${JSON.stringify(root.toJSON(), null, 2)}`;
schemaFile.setContent(fileContent);
Expand Down

0 comments on commit 3e69c05

Please sign in to comment.