Skip to content

(protographic) rpc Resolve method generation does not work if there are no arguments #2527

Description

@flymedllva

Component(s)

router

Component version

0.105.2

wgc version

0.105.2

controlplane version

router version

What happened?

Description

I don't understand how to make a resolver for a field without arguments. For this kind of scheme, a resolver is not generated

type Meow @key(fields: "id") {
    id: ID!
    superMeows: [SuperMeows!] @connect__fieldResolver(context: "id")
}

As I understand it, this happens because of if (field.args.length === 0) return in collectResolverRpcMethods, but I want to have a separate method (rpc) for resolving this field.
In order for the desired behavior to work, I need to come up with an argument like:

type Meow @key(fields: "id") {
    id: ID!
    superMeows(noop: Boolean): [SuperMeows!] @connect__fieldResolver(context: "id")
}

Expected Result

Gen rpc Resolve* without input in type field

Actual Result

Not gen rpc Resolve* without input in type field

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Package Manager: pnpm, npm, yarn, etc
Compiler(if manually compiled): (e.g., "go 14.2")

Router configuration

Router execution config

Log output

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestinternally-reviewedThe issue has been reviewed internally.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions