-
Notifications
You must be signed in to change notification settings - Fork 258
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(grpc): remove package from type names #1747
Changes from 3 commits
5649345
0bd007b
16a6ba7
88b6908
e3a4373
25ca494
9c57f92
1423084
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,11 @@ input NEWS_NEWS_ID @tag(id: "news.NewsId") { | |
id: Int | ||
} | ||
|
||
enum NEWS_STATUS @tag(id: "Status") { | ||
tusharmath marked this conversation as resolved.
Show resolved
Hide resolved
|
||
DRAFT | ||
PUBLISHED | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add tests for messages inside of messages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. news.proto already contains message inside of message https://github.com/tailcallhq/tailcall/pull/1747/files#diff-771adfaaae91c7816aaf69af02c57749bfaaaa74e3db399e055104a8a1a6de23R26-R33 is it enough? |
||
|
||
type GREETINGS_A_B_HELLO_REPLY @tag(id: "greetings_a.b.HelloReply") { | ||
message: String | ||
} | ||
|
@@ -49,12 +54,12 @@ type NEWS_NEWS_LIST @tag(id: "news.NewsList") { | |
} | ||
|
||
type Query { | ||
greetings_a_b_say_hello(hello_request: GREETINGS_A_B_HELLO_REQUEST!): GREETINGS_A_B_HELLO_REPLY! @grpc(method: "greetings_a.b.SayHello") | ||
greetings_b_c_say_hello(hello_request: GREETINGS_B_C_HELLO_REQUEST!): GREETINGS_B_C_HELLO_REPLY! @grpc(method: "greetings_b.c.SayHello") | ||
news_add_news(news: NEWS_NEWS!): NEWS_NEWS! @grpc(method: "news.AddNews") | ||
news_delete_news(news_id: NEWS_NEWS_ID!): NEWS_EMPTY! @grpc(method: "news.DeleteNews") | ||
news_edit_news(news: NEWS_NEWS!): NEWS_NEWS! @grpc(method: "news.EditNews") | ||
news_get_all_news: NEWS_NEWS_LIST! @grpc(method: "news.GetAllNews") | ||
news_get_multiple_news(multiple_news_id: NEWS_MULTIPLE_NEWS_ID!): NEWS_NEWS_LIST! @grpc(method: "news.GetMultipleNews") | ||
news_get_news(news_id: NEWS_NEWS_ID!): NEWS_NEWS! @grpc(method: "news.GetNews") | ||
greetings_a_b_say_hello(hello_request: GREETINGS_A_B_HELLO_REQUEST!): GREETINGS_A_B_HELLO_REPLY! @grpc(method: "greetings_a.b.Greeter.SayHello") | ||
greetings_b_c_say_hello(hello_request: GREETINGS_B_C_HELLO_REQUEST!): GREETINGS_B_C_HELLO_REPLY! @grpc(method: "greetings_b.c.Greeter.SayHello") | ||
news_add_news(news: NEWS_NEWS!): NEWS_NEWS! @grpc(method: "news.NewsService.AddNews") | ||
news_delete_news(news_id: NEWS_NEWS_ID!): NEWS_EMPTY! @grpc(method: "news.NewsService.DeleteNews") | ||
news_edit_news(news: NEWS_NEWS!): NEWS_NEWS! @grpc(method: "news.NewsService.EditNews") | ||
news_get_all_news: NEWS_NEWS_LIST! @grpc(method: "news.NewsService.GetAllNews") | ||
news_get_multiple_news(multiple_news_id: NEWS_MULTIPLE_NEWS_ID!): NEWS_NEWS_LIST! @grpc(method: "news.NewsService.GetMultipleNews") | ||
news_get_news(news_id: NEWS_NEWS_ID!): NEWS_NEWS! @grpc(method: "news.NewsService.GetNews") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider handling the potential
None
case in the chain of method calls fortype_name
instead of usingunwrap()
, which could lead to runtime panics if the conversion fails.Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, the
GraphQLType<Unparsed>::parse
that is used byas_enum
could be rewritten without return Option that could simplify usage of it and remove unwrapsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meskill, your suggestion to rewrite the
GraphQLType<Unparsed>::parse
method used byas_enum
to not return an Option is intriguing. Removing the Option could indeed simplify the usage by eliminating the need for unwraps. However, this change would require a careful review of all places where this method is used to ensure that there are no cases where aNone
return is expected or required.Would you like to proceed with exploring this change in the current PR, or would you prefer to handle this as a separate task? If it's the latter, I can help by opening a GitHub issue to track this enhancement. Please let me know how you'd like to proceed!