Skip to content

GraphQL Client: Namespace Client Types and Fields #245

@nalchevanidze

Description

@nalchevanidze

Problems:

1. Type name collision:

Problems on Recursive types and alias selections

For example If we have:

type Person (id: ID) {
   name: String!
   parent: Person!
   friend: Person!
}

And we select

{ 
 user {
   name
    friend { 
      name
    }
    parent {
      name
    }
    bestFriend: friend {
      name
      parent {
        name
      }
    }
  }
}

We have to Generate 5 Person types with diferent subsets of field, how we name them?

Solution:

  • User from {user
  • UserFriend: from {user{freind
  • UserParent: from {user{parent
  • UserBestFriend: from {user{bestFrend
  • UserBestFriendParent: from {user{bestFrend{parent

each type will have fields with type namespace

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed📦 clientLabel for affected Package: "morpheus-graphql-client"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions