Skip to content

Add support for inline fragments #52

@rickschubert

Description

@rickschubert

This library does not yet support GraphQL inline fragments. But this feature is supported by our "mirror library" json-to-graphql-query, see readme link on their project: https://github.com/vkolgi/json-to-graphql-query?tab=readme-ov-file#query-with-inline-fragments

We want to add support for inline fragments

Example syntax

{
  fieldName {
    ... on TypeName {
      field1
      field2
      # Additional fields specific to TypeName
    }
    ... on OtherTypeName {
      field3
      field4
      # Additional fields specific to OtherTypeName
    }
    # Additional fields common to all types
  }
}

Acceptance Criteria

  • We have done our research on inline fragments and regarding their behaviour
  • Our library supports inline fragments in a way that mirrors and complements our "partner" library json-to-graphql-query
  • We have extensive tests to to prove the feature
  • We have updated the readme as well as the readme example tests to highlight this new feature

(Initially brought up in the discussion on PR #23 , see here )

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