Reject enum values, interface fields and union members that a type declares twice in 15.0.0
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 76/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- graphql, kotlin
- Domínio
- backend-api-design, testing
Direção de pesquisa
Start with SchemaParser#warnRepeated, createEnumObject, and createInterfaceObject, then read the repeats covered by TypeExtensionTest.repeats and extensions without a type keep building. Move those cases into an error test and check that the SchemaError names the type and repeated value, field, or member. Update the 15.0.0 release notes; done means repeats are rejected and the tests verify the error.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Since #855, extensions are merged into the type they extend. When a type ends up declaring an enum value, interface field or union member twice, e.g. in the type and again in an extension, tools keeps the first one and logs a warning:
enum Color { RED }
extend enum Color { RED GREEN }
Type 'Color' declares value 'RED' more than once, only the first one is kept.
graphql-java's SchemaGenerator rejects these schemas, and the spec doesn't allow an extension to redeclare what the type already has. But they built before #855, since the extension used to replace the type, so failing on them has to wait for a major release.
Keeping the first one hides mistakes though. interface Node { id: ID } plus extend interface Node { id: String } builds with id: ID, and only a log line says the extension's id was dropped.
What to change
- replace the warning in
SchemaParser#warnRepeatedwith aSchemaErrorthat names the type and the repeated value, field or member - drop the
distinctBy { it.name }on the enum values increateEnumObjectand the interface fields increateInterfaceObject - move the repeats out of
TypeExtensionTest.repeats and extensions without a type keep buildinginto a test for the error - mention it in the 15.0.0 release notes
- Linguagem predominante
- Kotlin
- Estrelas
- 824
- Forks
- 175
- Merge médio
- 2d 5h
- PRs com merge (30d)
- 52
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de graphql-java-kickstart/graphql-java-tools
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
graphql-java-kickstart/graphql-java-tools#893 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 74/100
graphql-java-kickstart/graphql-java-tools#896 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
graphql-java-kickstart/graphql-java-tools#889 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
graphql-java-kickstart/graphql-java-tools#886 ·
Mantenedores costumam responder em até 1 dia
-
Reject directives applied at the wrong location, without a required argument or twice in 15.0.0Abertaenhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
graphql-java-kickstart/graphql-java-tools#884 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de graphql-java-kickstart/graphql-java-tools
Issues semelhantes
-
enhancement impact:U1 P3 reach:R2 size:S
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
ankidroid/Anki-Android#22677 ·
Mantenedores costumam responder em até 1 dia
-
Type Pick Request
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
reactwg/react-native-releases#1456 · 1 comentário ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
yschimke/homeassistant-remotecompose#1038 ·
Mantenedores costumam responder em até 1 dia
-
area:data-quality importer size:S
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
enorm-labs/event-junkie#3707 ·
Mantenedores costumam responder em até 1 dia