Have an option to return multiple aliases for the same field

Open
#501 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
fsharp, graphql
Domain
api, backend

Research direction

Start by tracing how Define.Object fields are resolved and how aliases and @filter arguments are handled during query execution. Reproduce the People query from the issue, then verify that friends and girlFriends resolve the same underlying field while retaining their distinct filters and results.

Written by the indexing model from the issue text.

Description

Currently we allow returning only as many fields as defined in the schema using Define.Object.

However GraphQL allows for querying additional output fields by aliasing existing ones.

query {
  People {
    name
    friends
    girlFriends: friends @filter(gender: Female)
  }
}

Notice how friends and girlFriends both refer to the same underlying friends field.

Currently this library does not provide for this functionality:
it does return both friends and girlFriends but both have identical content.

Dominant language
F#
Stars
406
Forks
74
Avg merge
1d 8h
Merged PRs (30d)
14

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fsprojects/FSharp.Data.GraphQL

All issues in fsprojects/FSharp.Data.GraphQL

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.