7373 first: 400,
7474 filterBy: {
7575 countryCode: "JP",
76- verified: true
76+ # verified: true # This does NOT change on number_of_dojos
7777 }
7878 ) {
7979 nodes {
@@ -121,11 +121,11 @@ def request_data(query:, variables:)
121121dojo_data = [ ]
122122unique_ids = Set . new
123123page_number = 0
124- print 'Fetching page by page: '
125124
126125# Fetch clubs for Japan without filtering by brand
127126variables = { after : nil }
128127query = JP_DOJOS_QUERY
128+ print ' JP_DOJOS_QUERY: '
129129begin
130130 print "#{ page_number = page_number . succ } .."
131131 fetched_data = request_data ( query : query , variables : variables )
@@ -138,10 +138,12 @@ def request_data(query:, variables:)
138138 page_info = fetched_data [ :pageInfo ]
139139 variables [ :after ] = page_info [ :endCursor ]
140140end while page_info [ :hasNextPage ]
141+ puts " (JP: #{ dojo_data . count } )"
141142
142143# Fetch clubs for other countries with filtering by brand
143144variables = { after : nil }
144145query = ALL_DOJOS_QUERY
146+ print 'ALL_DOJOS_QUERY: '
145147begin
146148 print "#{ page_number = page_number . succ } .."
147149 fetched_data = request_data ( query : query , variables : variables )
@@ -154,6 +156,7 @@ def request_data(query:, variables:)
154156 page_info = fetched_data [ :pageInfo ]
155157 variables [ :after ] = page_info [ :endCursor ]
156158end while page_info [ :hasNextPage ]
159+ puts " (Total: #{ dojo_data . count } )"
157160
158161File . write ( 'tmp/number_of_dojos' , dojo_data . length )
159162File . open ( 'dojos_earth.json' , 'w' ) do |file |
0 commit comments