Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tusharmath opened this issue Apr 2, 2024 · 9 comments
Open
Labels
💎 Bounty type: bug Something isn't working.

Comments

@tusharmath
Copy link
Contributor

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
Copy link
Contributor Author

/bounty 10$

Copy link

algora-pbc bot commented Apr 2, 2024

💎 $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

@ssddOnTop
Copy link
Contributor

ssddOnTop commented Apr 2, 2024

/attempt

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

@ssddOnTop
Copy link
Contributor

ssddOnTop commented Apr 2, 2024

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.

@tusharmath tusharmath added the type: bug Something isn't working. label Apr 2, 2024
@LED-0102
Copy link

LED-0102 commented Apr 3, 2024

/attempt

Copy link

algora-pbc bot commented Apr 4, 2024

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

@sn99
Copy link

sn99 commented Apr 4, 2024

/attempt #1625

Copy link

algora-pbc bot commented Apr 4, 2024

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.

@sn99
Copy link

sn99 commented Apr 4, 2024

@tusharmath I made the PR based on the suggestions above: #1625 (comment).

@tusharmath tusharmath changed the title bug: input types loose out on provided graphQL documentation bug(config): input types loose out on provided graphQL documentation Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty type: bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants