Skip to content

Enums doc is wrong #1029

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

Closed
RDruon opened this issue Feb 24, 2022 · 2 comments · Fixed by #1230
Closed

Enums doc is wrong #1029

RDruon opened this issue Feb 24, 2022 · 2 comments · Fixed by #1230
Assignees
Labels
bug Something isn't working k::documentation Related to project documentation
Milestone

Comments

@RDruon
Copy link

RDruon commented Feb 24, 2022

Describe the bug
Enums docs states that corresponding string values for the enum variants are all in uppercase. This is not the case

To Reproduce
Declare an enum like

#[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "graphql", derive(juniper::GraphQLEnum))]
pub enum ConfigType {
    New,
    AlreadyExisting,
}

When querying the GraphQL enum I got the following output

[root@node1 ~]# curl -k https://localhost/graphql_schema 2> /dev/null | grep "enum ConfigType" -A 4
enum ConfigType {
  NEW
  ALREADY_EXISTING
}

Expected behavior
Following the docs I was expecting:

[root@node1 ~]# curl -k https://localhost/graphql_schema 2> /dev/null | grep "enum ConfigType" -A 4
enum ConfigType {
  NEW
  ALREADYEXISTING
}
@RDruon RDruon added bug Something isn't working needs-triage labels Feb 24, 2022
@RDruon
Copy link
Author

RDruon commented Feb 24, 2022

I think it originated from #765 and the docs weren't updated

@tyranron
Copy link
Member

tyranron commented Feb 24, 2022

@RDruon thanks!

I've haven't found anything about what variant is right in GraphQL spec.

But Apollo docs say:

  • Enum values should use ALL_CAPS, because they are similar to constants.

@ilslv so the current behavior is preferred, and we need to updated the relevant docs only.

@tyranron tyranron added the k::documentation Related to project documentation label Feb 24, 2022
@tyranron tyranron added this to the 0.16.0 milestone Oct 27, 2023
@tyranron tyranron assigned tyranron and unassigned ilslv Oct 27, 2023
@tyranron tyranron mentioned this issue Dec 1, 2023
31 tasks
@tyranron tyranron linked a pull request Dec 1, 2023 that will close this issue
31 tasks
tyranron added a commit that referenced this issue Mar 20, 2024
- rework and update existing chapters
- mention correct case transformation for GraphQL enums (#1029)
- document N+1 mitigation techniques and look-ahead features (#234, #444)
- mention all integration crates (#867)
- fix Book links (#679, #974, #1056)
- remove old version of Book (#1168)

Additionally:
- disable `bson`, `url`, `uuid` and `schema-language` Cargo features by default in `juniper` crate

Co-authored-by: Christian Legnitto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working k::documentation Related to project documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants