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

Fix missing return annotation in get_customer docs #3642

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

Skeen
Copy link
Member

@Skeen Skeen commented Sep 23, 2024

Description

The example under: "Defining extra types when using Interfaces" on https://strawberry.rocks/docs/types/schema contains an example, which does not run.

Using the documentation as-is produces this error:

MissingReturnAnnotationError: Return annotation missing for field "get_customer", did you forget to add it?

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Summary by Sourcery

Correct the return annotation in the 'get_customer' function example in the documentation to prevent runtime errors and improve clarity.

Documentation:

  • Fix the missing return annotation in the 'get_customer' function example in the documentation to ensure it runs without errors.

Using the documentation as-is produces this error:
```
MissingReturnAnnotationError: Return annotation missing for field "get_customer", did you forget to add it?
```
Copy link
Contributor

sourcery-ai bot commented Sep 23, 2024

Reviewer's Guide by Sourcery

This pull request fixes a missing return annotation in the documentation example for the get_customer method. The change addresses an error that users would encounter when trying to run the example as-is from the documentation.

File-Level Changes

Change Details Files
Added missing return annotation to the get_customer method example
  • Added -> Customer as the return type annotation for the get_customer method
  • Removed the commented-out return type annotation
docs/types/schema.md

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Skeen - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Copy link
Member

@DoctorJohn DoctorJohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks you very much @Skeen

@DoctorJohn DoctorJohn merged commit 18f0f5d into strawberry-graphql:main Sep 23, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants