ChilliCream / ChilliCream/graphql-platform

Default name of `fsp`

Open
#6,576 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate 🗣 discussion Area: Fusion
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

Product

Hot Chocolate

Is your feature request related to a problem?

Currently the default name of the fsp of dotnet fusion pack is the name of the Folder it is packed in

This default behaviour makes it harder to integrate into a CI pipeline as you always have to specify --package to get a consistent output.

e.g. for a simple build script you get:

dotnet tool restore
dotnet build
dotnet run -p Subgraphs/Accounts -- schema export --output schema.graphql
dotnet run -p Subgraphs/Products -- schema export --output schema.graphql
dotnet run -p Subgraphs/Shipping -- schema export --output schema.graphql
dotnet run -p Subgraphs/Reviews -- schema export --output schema.graphql

dotnet fusion subgraph pack --working-directory ./Subgraphs/Accounts
dotnet fusion subgraph pack --working-directory ./Subgraphs/Products
dotnet fusion subgraph pack --working-directory ./Subgraphs/Shipping
dotnet fusion subgraph pack --working-directory ./Subgraphs/Reviews

 dotnet fusion compose -p ./Gateway/gateway.fgp -s ./Subgraphs/Accounts/accounts.fsp
 dotnet fusion compose -p ./Gateway/gateway.fgp -s ./Subgraphs/Products/products.fsp
 dotnet fusion compose -p ./Gateway/gateway.fgp -s ./Subgraphs/Shipping/shipping.fsp
 dotnet fusion compose -p ./Gateway/gateway.fgp -s ./Subgraphs/Reviews/reviews.fsp

if you want to have the same fsp names you have to specify:

dotnet tool restore
dotnet build
dotnet run -p Subgraphs/Accounts -- schema export --output schema.graphql
dotnet run -p Subgraphs/Products -- schema export --output schema.graphql
dotnet run -p Subgraphs/Shipping -- schema export --output schema.graphql
dotnet run -p Subgraphs/Reviews -- schema export --output schema.graphql

dotnet fusion subgraph pack --working-directory ./Subgraphs/Accounts --package subgraph.fsp
dotnet fusion subgraph pack --working-directory ./Subgraphs/Products --package subgraph.fsp
dotnet fusion subgraph pack --working-directory ./Subgraphs/Shipping --package subgraph.fsp
dotnet fusion subgraph pack --working-directory ./Subgraphs/Reviews --package subgraph.fsp

 dotnet fusion compose -p ./Gateway/gateway.fgp -s ./Subgraphs/Accounts/subgraph.fsp
 dotnet fusion compose -p ./Gateway/gateway.fgp -s ./Subgraphs/Products/subgraph.fsp
 dotnet fusion compose -p ./Gateway/gateway.fgp -s ./Subgraphs/Shipping/subgraph.fsp
 dotnet fusion compose -p ./Gateway/gateway.fgp -s ./Subgraphs/Reviews/subgraph.fsp
The solution you'd like

As you in most cases anyway have one subgraph document per service, i believe it would be better if the output is subgraph.fsp by default (and gateway.gsp on compose)

Because then we can also have defaults to assume that a subgraph contains a fsp. which makes the default behaviour a lot simpler:

dotnet tool restore
dotnet build
dotnet run -p Subgraphs/Accounts -- schema export --output schema.graphql
dotnet run -p Subgraphs/Products -- schema export --output schema.graphql
dotnet run -p Subgraphs/Shipping -- schema export --output schema.graphql
dotnet run -p Subgraphs/Reviews -- schema export --output schema.graphql

dotnet fusion subgraph pack --working-directory ./Subgraphs/Accounts 
dotnet fusion subgraph pack --working-directory ./Subgraphs/Products 
dotnet fusion subgraph pack --working-directory ./Subgraphs/Shipping
dotnet fusion subgraph pack --working-directory ./Subgraphs/Reviews 

 dotnet fusion compose -p ./Gateway -s ./Subgraphs/Accounts
 dotnet fusion compose -p ./Gateway -s ./Subgraphs/Products
 dotnet fusion compose -p ./Gateway -s ./Subgraphs/Shipping
 dotnet fusion compose -p ./Gateway -s ./Subgraphs/Reviews

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating the dotnet fusion subgraph pack and dotnet fusion compose command entry points. Trace how default package and gateway filenames are selected, then verify that omitted options produce subgraph.fsp and gateway.gsp, and that composing from the working directories uses those defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.