core icon indicating copy to clipboard operation
core copied to clipboard

Add in-depth Duels stats to GraphQL spec

Open Shqrp opened this issue 5 years ago • 6 comments

Hey there,

I added Duels types to the spec. Tell me if everything is correct!

Shqrp avatar Nov 14 '20 20:11 Shqrp

Thank you for your contribution!

builder-247 avatar Nov 14 '20 20:11 builder-247

Have you found the GraphQL syntax error?

https://travis-ci.org/github/slothpixel/core/builds/743652902#L388

builder-247 avatar Nov 16 '20 10:11 builder-247

Oh, I see! The problem is that I can't use an integer as a field's name in a GraphQL type. I tried searching on the web, but I couldn't find anything, so I ask you (that I'm sure know better me) is it possible to wrap it around quotes, like this?

type Layout {
  '0': String
  '1': String
  ... ...
}

Shqrp avatar Nov 16 '20 15:11 Shqrp

Ok, checked GraphQL Specification, and can confirm a field's name must be a string. image

Can't use single quote or double-quote either. image

I just need to thing a solution for this, I may use an array of values, so instead of accessing Layout.0 it would be Layout[0]. I hope to find a solution. 😅

EDIT: I confirm I'll just straight up delete the Layout type, and just do an array of strings: the problem is that, for example normal UHC layout contains elements 0, 1, 2, 3, 4, 5, 6, 7, 8, 33, 34, 35 but if the array doesn't contain any empty element it would be normal for the first 9 elements, but for 33, 34, 35 they would be assigned to indexes 9, 10, 11 respectively. So we'll need something to counter this in spec.js. Sorry if i'm writing an essay, but it's basically my first time doing a serious pull request so I want to communicate as best as I can.

Shqrp avatar Nov 19 '20 10:11 Shqrp

Also if you could help me update spec.js while I try to find a solution to this, that would be amazing :D

Shqrp avatar Nov 19 '20 10:11 Shqrp

Hey, and thank you again for taking your time to help the project.

Unfortunately I just now realized that Duels stats currently present are only temporary, and are meant to be replaced by https://github.com/slothpixel/core/pull/474, which has been waiting for minor changes for a while.

Could you work on documenting this new format?

builder-247 avatar Nov 19 '20 17:11 builder-247