{"_id":"@catalystsquad/proto2graphql","_rev":"1-865ae0ed7d2ad8d712a1b3e4f058aea5","name":"@catalystsquad/proto2graphql","dist-tags":{"latest":"0.1.3-alpha"},"versions":{"0.1.3-alpha":{"name":"@catalystsquad/proto2graphql","version":"0.1.3-alpha","description":"Converts schema definitions in Protocol Buffer to GraphQL","main":"./lib/index.js","bin":{"proto2graphql":"bin/proto2graphql"},"scripts":{"clean":"rm -rf ./lib ./protos","build":"tsc -p .","test":"nyc mocha -r ts-node/register **/test/*.spec.ts","coverage":"nyc report --reporter=text-lcov | coveralls","pull:wkt":"scripts/pull-wkt.sh"},"repository":{"type":"git","url":"git+https://github.com/catalystsquad/proto2graphql.git"},"keywords":["proto","protobuf","pb","graphql","sdl","protocol","buffers","schema"],"author":{"name":"Aurelio Agundez"},"license":"MIT","bugs":{"url":"https://github.com/catalystsquad/proto2graphql/issues"},"homepage":"https://github.com/catalystsquad/proto2graphql#readme","dependencies":{"commander":"^4.0.1","graphql":"^14.5.8","protobufjs":"^6.8.8"},"devDependencies":{"@types/chai":"^4.2.7","@types/commander":"^2.12.2","@types/graphql":"^14.5.0","@types/mocha":"^5.2.7","chai":"^4.2.0","coveralls":"^3.0.9","mocha":"^6.2.2","mocha-lcov-reporter":"^1.3.0","nyc":"^15.0.0","ts-node":"^8.5.4","typescript":"^3.7.4"},"publishConfig":{"access":"public"},"gitHead":"415ebffb2e74a527e44cc94f5123d01cf8c7fe36","_id":"@catalystsquad/proto2graphql@0.1.3-alpha","_nodeVersion":"16.5.0","_npmVersion":"8.6.0","dist":{"integrity":"sha512-YgvkSypu2xC7gcyhAPu8O3XRx1M9JP/5GWd1RI3r1Q0zvgDi4tkLTIy3yuZ7kGPfjZ6n1IPQsOi3/CrmPpSy0w==","shasum":"1f41e1152ae94f5830a4b3e5ef85ec426a1352dc","tarball":"https://registry.npmjs.org/@catalystsquad/proto2graphql/-/proto2graphql-0.1.3-alpha.tgz","fileCount":17,"unpackedSize":42283,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFi4WVKUk5hh+7eZCHmEDvynwLuWyrm8VjSs42i0qewAiAgOwRPUf51C45mDZ0C0tBajXhnTXqj5m0PZwavUtGdqg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihmcsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrmog//YO2TbAIY1F8skSB/Th9s0ihBRRSQtyPPdMtDyJ7Psz4rgogh\r\nWTW3He6ntZn7QvyNwbtHSS2WmIEhpLGZQrh38NiFbhAG+FZqLiGZNnoxOsKe\r\nos9BYM0r3CNdMmeRp4RZ2u1uAPOviJjsFJsXXqhqpkGNmvnow0wt9sHH6Ywe\r\n2A5u0FlTZQj+DigHybSpyADbpsc+RKuZ6GEpIG27yrxh5HX5IccgIOs9gI9R\r\n1qjr0LU5PAZ+0uGhVfqv6HHTPhJqi3ca/iuHlE4+Cw2J/LjixdNQG4PQ8ycN\r\nS/KhPZRZqbUADri9H4zt+80m5EmicfUGL37Zht6Xbh/Ol4BolX5c+vN+snOG\r\nMwwaQgSNmGroR3ezn2w9nnx482xzfYnphPypwrM5v9kztXTZAP/qn5hiBqfn\r\nTxzBIEbrN1WQplIbLYeeDk8Ms6nk4prX+aEJOv/RNAHHe2zNVc3ckxWdyBkp\r\ns9fE3PoZm7g1N47Pu8e2lpUCNXAZAtxK3p9Dx3Nxu6Jq0RO+rXm3SmiPOj6W\r\nm54Ps5nxPqeeHjmK5tal9C0IByJeMP7xWUlu0ePpcMTM7bowdOGJB+4OKZmh\r\n+FSGDPcxI/98jJeE3mk4dyCFeOM/r/w0KfFIkOmw2pnRyDmZMICHD1QGIobY\r\nvTz4m9jSiNvBoZOkH98/J368sm/5XEH2zoY=\r\n=Dq0F\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"automation-catalystsquad","email":"automation.catalystsquad@gmail.com"},"directories":{},"maintainers":[{"name":"automation-catalystsquad","email":"automation.catalystsquad@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/proto2graphql_0.1.3-alpha_1652975404271_0.2073336886884638"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-19T15:50:04.226Z","0.1.3-alpha":"2022-05-19T15:50:04.444Z","modified":"2023-05-18T23:42:21.045Z"},"maintainers":[{"email":"npmjs.com@todandlorna.com","name":"todpunk"},{"email":"automation.catalystsquad@gmail.com","name":"automation-catalystsquad"}],"description":"Converts schema definitions in Protocol Buffer to GraphQL","homepage":"https://github.com/catalystsquad/proto2graphql#readme","keywords":["proto","protobuf","pb","graphql","sdl","protocol","buffers","schema"],"repository":{"type":"git","url":"git+https://github.com/catalystsquad/proto2graphql.git"},"author":{"name":"Aurelio Agundez"},"bugs":{"url":"https://github.com/catalystsquad/proto2graphql/issues"},"license":"MIT","readme":"# proto2graphql [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/proto2graphql.svg?style=flat)](https://www.npmjs.com/package/proto2graphql) [![CircleCI Status](https://circleci.com/gh/emzeq/proto2graphql.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/emzeq/proto2graphql) [![Coverage Status](https://coveralls.io/repos/github/emzeq/proto2graphql/badge.svg)](https://coveralls.io/github/emzeq/proto2graphql)\n\nConverts schema definitions in Protocol Buffer (proto3) to GraphQL. Can be used to help generate a GraphQL API gateway to gRPC backend services.\n\n## Installation\n\n`npm install -g proto2graphql`\n\n## Usage\n\n`proto2graphql --input [input .proto path] --output [output .graphql path]`\n\n## Conversions\n\n### Messages\n\n#### Protocol Buffer\n\n```protobuf\nmessage SearchRequest {\n  string query = 1;\n  int32 page_number = 2;\n  int32 result_per_page = 3;\n}\n```\n\n#### GraphQL\n\n```graphql\ntype SearchRequest {\n  query: String\n  pageNumber: Int\n  resultPerPage: Int\n}\n```\n\n### Scalar Value Types\n\n| Protocol Buffer | GraphQL |\n| --------------: | ------: |\n|          double |   Float |\n|           float |   Float |\n|           int32 |     Int |\n|           int64 |     Int |\n|          uint32 |     Int |\n|          uint64 |     Int |\n|          sint32 |     Int |\n|          sint64 |     Int |\n|         fixed32 |     Int |\n|         fixed64 |     Int |\n|        sfixed32 |     Int |\n|        sfixed64 |     Int |\n|            bool | Boolean |\n|          string |  String |\n|           bytes |  String |\n\n### Enumerations\n\n#### Protocol Buffer\n\n```protobuf\nenum Corpus {\n  UNIVERSAL = 0;\n  WEB = 1;\n  IMAGES = 2;\n  LOCAL = 3;\n  NEWS = 4;\n  PRODUCTS = 5;\n  VIDEO = 6;\n}\n```\n\n#### GraphQL\n\n```graphql\nenum Corpus {\n  UNIVERSAL\n  WEB\n  IMAGES\n  LOCAL\n  NEWS\n  PRODUCTS\n  VIDEO\n}\n```\n\n### Nested Types\n\n#### Protocol Buffer\n\n```protobuf\nmessage SearchResponse {\n  message Result {\n    string url = 1;\n    string title = 2;\n  }\n  Result result = 1;\n}\n```\n\n#### GraphQL\n\n```graphql\ntype SearchResponse {\n  results: SearchResponse_Result\n}\n\ntype SearchResponse_Result {\n  url: String\n  title: String\n}\n```\n\n### Oneof\n\n#### Protocol Buffer\n\n```protobuf\nmessage UserAuth {\n  message GoogleProvider {\n    int32 gid = 1;\n  }\n\n  message FacebookProvider {\n    string fbid = 1;\n  }\n\n  oneof provider {\n    GoogleProvider google = 1;\n    FacebookProvider facebook = 2;\n    string generic = 3;\n  }\n}\n```\n\n#### GraphQL\n\n```graphql\ntype UserAuth {\n  provider: UserAuth_provider\n}\n\nunion UserAuth_provider =\n    UserAuth_GoogleProvider\n  | UserAuth_FacebookProvider\n  | String\n\ntype UserAuth_GoogleProvider {\n  gid: Int\n}\n\ntype UserAuth_FacebookProvider {\n  fbid: String\n}\n```\n\n### Maps\n\n#### Protocol Buffer\n\n```protobuf\nmessage User {\n  map<string, Attribute> attributes = 1;\n}\n\nmessage Attribute {\n  string value = 1;\n}\n```\n\n#### GraphQL\n\n```graphql\ntype User {\n  attributes: [String_Attribute_map]\n}\n\ntype String_Attribute_map {\n  key: String\n  value: Attribute\n}\n\ntype Attribute {\n  value: String\n}\n```\n\n### Packages\n\n#### Protocol Buffer\n\n```protobuf\npackage proto2graphql.common;\n\nmessage TypeA {\n  int32 field = 1;\n}\n```\n\n#### GraphQL\n\n```graphql\ntype proto2graphql_common_TypeA {\n  field: Int\n}\n```\n\n### Well-Known Types\n\n#### Protocol Buffer\n\n```protobuf\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nmessage WellKnownTypes {\n  google.protobuf.Duration duration_field = 1;\n  google.protobuf.Timestamp timestamp_field = 2;\n}\n```\n\n#### GraphQL\n\n```graphql\ntype WellKnownTypes {\n  durationField: google_protobuf_Duration\n  timestampField: google_protobuf_Timestamp\n}\n\ntype google_protobuf_Duration {\n  seconds: Int\n  nanos: Int\n}\n\ntype google_protobuf_Timestamp {\n  seconds: Int\n  nanos: Int\n}\n```\n","readmeFilename":"README.md"}