Giter VIP home page Giter VIP logo

proto-graphql-js's Introduction

proto-graphql-js's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar izumin5210 avatar qnighy avatar renovate-bot avatar renovate[bot] avatar takizuka avatar yyoshiki41 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

proto-graphql-js's Issues

graphql.*.name option

input

message User {
  // Required.
  int64 id = 1 [graphql.field.name = "databaseId"];
}

output

export const User = objectType({
  name: "User",
  definition(t) {
    t.field.("databaseId", {
      type: nonNull("Int"),
      resolve(root) { return root.getId() }
    });
  }
});
  • object
  • field
  • union
  • enum
  • enum value

๐Ÿ›๐Ÿ›๐Ÿ› proto-gen-nexus for google.Type.Date issue

We got an error when we tried to generate the nexus field for google.Type.Date by using the proto-gen-nexus (version: 0.6.2).

Expected Behavior

  t.field("birthday", {
    type: nullable("Date"),
    resolve: (source) => {
      const value = source.getBirthday();
      if (value == null) {
        return null;
      }
      // THE EXPECTED
      return getTransformer("google.type.Date").protoToGql(value);
    },
    extensions: {
      protobufField: { name: "birthday", typeFullName: "google.type.Date" },
    },

Current Behavior

  t.field("birthday", {
      type: nullable("Date"),
      resolve: (source) => {
        const value = source.getBirthday();
        if (value == null) {
          return null;
        }
        // ACTUALITY
        return value;
      },
      extensions: {
        protobufField: { name: "birthday", typeFullName: "google.type.Date" },
      }

Root cause

The error was found when handling WellKnownType. Currently, it only handles google.protobuf type (by isProtobufWellKnownType), but does not handle google.Type (google.Type.Date)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @biomejs/biome to v1.7.3
  • chore(deps): update dependency @swc/core to v1.5.5
  • chore(deps): update dependency @types/node to v20.12.11
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/actions/setup-node/action.yml
.github/workflows/check-pr-labels.yml
.github/workflows/ci.yml
.github/workflows/release.yml
npm
devPackages/testapis-proto/package.json
devPackages/tsconfig/package.json
e2e/helper/package.json
e2e/testapis/google-protobuf/package.json
e2e/testapis/protobufjs/package.json
e2e/testapis/ts-proto-with-forcelong-long/package.json
e2e/testapis/ts-proto-with-forcelong-number/package.json
e2e/testapis/ts-proto/package.json
package.json
  • @biomejs/biome 1.7.1
  • @bufbuild/buf 1.27.0
  • @bufbuild/protoc-gen-es 1.8.0
  • @changesets/changelog-github 0.5.0
  • @changesets/cli 2.27.1
  • @pothos/core 3.41.1
  • @swc/core 1.5.0
  • @types/google-protobuf 3.15.12
  • @types/minimatch 5.1.2
  • @types/node 20.12.7
  • google-protobuf 3.21.2
  • graphql 16.8.1
  • graphql-scalars 1.23.0
  • minimatch 5.1.2
  • nexus 1.3.0
  • protobufjs 7.2.5
  • protobufjs-cli 1.1.2
  • ts-proto 1.129.0
  • ts-protoc-gen 0.15.0
  • tsup 8.0.2
  • tsx 4.7.2
  • turbo 1.10.15
  • typescript 5.4.5
  • vitest 1.5.1
  • pnpm 9.0.5
packages/@proto-graphql/codegen-core/package.json
packages/@proto-graphql/proto-descriptors/package.json
packages/@proto-graphql/protoc-plugin-helpers/package.json
packages/@proto-nexus/google-protobuf/package.json
packages/@proto-nexus/proto-fields-plugin/package.json
packages/@proto-nexus/protobufjs/package.json
packages/proto-nexus/package.json
packages/protoc-gen-nexus/package.json
packages/protoc-gen-pothos/package.json

  • Check this box to trigger a request for Renovate to run again on this repository

graphql.field.id option

input

message User {
  // Required.
  int64 id = 1 [graphql.field.id = true];
}

output

export const User = objectType({
  name: "User",
  definition(t) {
    t.field.("databaseId", {
      type: nonNull("ID"),
      resolve(root) { return root.getId() }
    });
  }
});

Support oneof

input:

message Entry {
  // ...

  oneof content {
    Text text = 11;
    Image image = 12;
    Link link = 13;
  }
}


message Text {
  // ...
}


message Image {
  // ...
}


message Link {
  // ...
}

output:

const Entry = objectType({
  // ...
})

const EntryContent = unionType({
  name: 'EntryContent',
  definition(t) {
    t.members('Text', 'Image', 'Link')
  },
  resolveType: (item) => {
    // ...
  },
  sourceType: {
    // ...
  }
})

const Text = objectType({
  // ...
})

const Image = objectType({
  // ...
})

const Link = objectType({
  // ...
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.