graphql-framework-experiment icon indicating copy to clipboard operation
graphql-framework-experiment copied to clipboard

Support nodes shorthand in connections

Open jasonkuhrt opened this issue 4 years ago • 1 comments

Perceived Problem

  • relay connections spec can be verbose for clients

Ideas / Proposed Solution(s)

  • a lot of benefit can be maintained but with less verbosity by dropping edges

    query {
      products(first: 100) {
        edges {
          node {
            name
          }
        }
      }
    }
    
    # Excerpt From: Marc-Andre Giroux. “Production Ready GraphQL.”
    

    to:

    query {
      products(first: 100) {
        nodes {
          name
        }
      }
    }
    
    # Excerpt From: Marc-Andre Giroux. “Production Ready GraphQL.”
    
  • allow api authors to choose between three styles:

    1. nodes and edges
    2. just nodes
    3. just edges

jasonkuhrt avatar Jul 04 '20 18:07 jasonkuhrt

Looks like an option to include the nodes field was added: https://nexus.js.org/docs/plugin-connection#including-a-nodes-field

JCMais avatar Aug 05 '20 02:08 JCMais