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

Add Schema.max_query_strings_tokens limit #4929

Merged
merged 4 commits into from Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,7 +1,7 @@
#include "graphql_c_parser_ext.h"

VALUE GraphQL_CParser_Lexer_tokenize_with_c_internal(VALUE self, VALUE query_string, VALUE fstring_identifiers, VALUE reject_numbers_followed_by_names) {
return tokenize(query_string, RTEST(fstring_identifiers), RTEST(reject_numbers_followed_by_names));
VALUE GraphQL_CParser_Lexer_tokenize_with_c_internal(VALUE self, VALUE query_string, VALUE fstring_identifiers, VALUE reject_numbers_followed_by_names, VALUE max_tokens) {
return tokenize(query_string, RTEST(fstring_identifiers), RTEST(reject_numbers_followed_by_names), FIX2INT(max_tokens));
}

VALUE GraphQL_CParser_Parser_c_parse(VALUE self) {
Expand All @@ -13,7 +13,7 @@ void Init_graphql_c_parser_ext() {
VALUE GraphQL = rb_define_module("GraphQL");
VALUE CParser = rb_define_module_under(GraphQL, "CParser");
VALUE Lexer = rb_define_module_under(CParser, "Lexer");
rb_define_singleton_method(Lexer, "tokenize_with_c_internal", GraphQL_CParser_Lexer_tokenize_with_c_internal, 3);
rb_define_singleton_method(Lexer, "tokenize_with_c_internal", GraphQL_CParser_Lexer_tokenize_with_c_internal, 4);
setup_static_token_variables();

VALUE Parser = rb_define_class_under(CParser, "Parser", rb_cObject);
Expand Down