tailcall icon indicating copy to clipboard operation
tailcall copied to clipboard

bug(config): input types loose out on provided graphQL documentation

Open tusharmath opened this issue 1 year ago • 9 comments

Documentation isn't copied into the blueprint for input types from configurations. For eg:

"""
Some Documentation
"""
input Foo {
  id: Int!
}

While using a configuration with an input type like the above, documentation isn't copied in the final schema.

Technical Requirements

  • Copy the documentation into the blueprint
  • Ensure integration tests are added

tusharmath avatar Apr 02 '24 07:04 tusharmath

/bounty 10$

tusharmath avatar Apr 02 '24 07:04 tusharmath

💎 $10 bounty • Tailcall Inc.

Steps to solve:

  1. Start working: Comment /attempt #1625 with your implementation plan
  2. Submit work: Create a pull request including /claim #1625 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

🙏 Thank you for contributing to tailcallhq/tailcall! 🧐 Checkout our guidelines before you get started.

Attempt Started (GMT+0) Solution
🔴 @ssddOnTop Apr 2, 2024, 7:37:58 AM WIP
🔴 @LED-0102 Apr 3, 2024, 7:50:48 AM WIP
🟢 @sn99 Apr 4, 2024, 11:29:10 AM WIP
🟢 @emekaokoli19 May 24, 2024, 12:43:06 AM #2015

algora-pbc[bot] avatar Apr 02 '24 07:04 algora-pbc[bot]

/attempt

Algora profile Completed bounties Tech Active attempts Options
@ssddOnTop 32 tailcallhq bounties
Rust, Java,
C & more
Cancel attempt

ssddOnTop avatar Apr 02 '24 07:04 ssddOnTop

cancelling my attempt.. I am busy with some other work.

For anyone who wants to attempt: in from_document.rs

convert:

TypeKind::InputObject(input_object_type) => {
                to_input_object(input_object_type, &type_definition.node.directives).some()
}

to

TypeKind::InputObject(input_object_type) => {
                to_input_object(input_object_type, &type_definition.node.description, &type_definition.node.directives)
}

and the new function should look like:

fn to_input_object(
    input_object_type: InputObjectType,
    description: &Option<Positioned<String>>,
    directives: &[Positioned<ConstDirective>],
) -> Valid<config::Type, String> {
    to_input_object_fields(&input_object_type.fields)
        .fuse(Protected::from_directives(directives.iter()))
        .map(|(fields, protected)| {
            let doc = description.to_owned().map(|pos| pos.node);
            config::Type { fields, protected, doc, ..Default::default() }
        })
}

now you just need to make sure it's passed to blueprint and write the tests as described in issue.

ssddOnTop avatar Apr 02 '24 08:04 ssddOnTop

/attempt

Options

LED-0102 avatar Apr 03 '24 07:04 LED-0102

@LED-0102: Reminder that in 1 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Apr 04 '24 07:04 algora-pbc[bot]

/attempt #1625

Options

sn99 avatar Apr 04 '24 11:04 sn99

[!NOTE] The user @LED-0102 is already attempting to complete issue #1625 and claim the bounty. We recommend checking in on @LED-0102's progress, and potentially collaborating, before starting a new solution.

algora-pbc[bot] avatar Apr 04 '24 11:04 algora-pbc[bot]

@tusharmath I made the PR based on the suggestions above: https://github.com/tailcallhq/tailcall/issues/1625#issuecomment-2031426868.

sn99 avatar Apr 04 '24 12:04 sn99

/attempt #1625

Options

emekaokoli19 avatar May 24 '24 00:05 emekaokoli19

[!NOTE] The user @sn99 is already attempting to complete issue #1625 and claim the bounty. We recommend checking in on @sn99's progress, and potentially collaborating, before starting a new solution.

algora-pbc[bot] avatar May 24 '24 00:05 algora-pbc[bot]

💡 @emekaokoli19 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar May 30 '24 12:05 algora-pbc[bot]

🎉🎈 @emekaokoli19 has been awarded $10! 🎈🎊

algora-pbc[bot] avatar May 31 '24 09:05 algora-pbc[bot]