Skip to content

how to calculate connection fields #60

@reconbot

Description

@reconbot

Hi!

I've got a connection field Network.channels

type Network {
  channels(
    after: String
    before: String
    first: Int
    last: Int
  ): ChannelConnection!
}

type ChannelConnection {
  edges: [ChannelEdge!]!
  nodes: [Channel!]!
  pageInfo: PageInfo!
}

type ChannelEdge {
  cursor: String!
  node: Channel!
}

type Channel {
  id: String!
}

So Network.channels takes an argument first or last which tells us how many nodes or edges the ChannelConnection is going to have. I can't use the field based custom estimator because the args are on the parent field and I don't access to the args when I'm calculating in the ChannelConnection.nodes or ChannelConnection.edges.

Is there a way to work around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions