Skip to content

Is __typename in idFields required when writing and reading fragments? #350

Description

@kvenn

I see the docs mention the use of write and read like so:

  client.writeFragment$PersonSummary(
    idFields: {'__typename': 'Person', 'id': '1'},
    data: person.copyWith(name: 'Kurt'),
  );

But from this change, the Fragment already knows its own typename : #247

Is it possible to generate a shorthand so I can just call it like so:

  client.writeFragment$PersonSummary(
    idFields: { 'id': '1'},
    data: person.copyWith(name: 'Kurt'),
  );

Or even better yet (since all of our idFields are the same for all our fragments):

  client.writeFragment$PersonSummary(
	id: '1'
    data: person.copyWith(name: 'Kurt'),
  );

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions