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

[feature]/support recursive type of type. #43

Closed
imiskolee opened this issue Mar 8, 2018 · 2 comments
Closed

[feature]/support recursive type of type. #43

imiskolee opened this issue Mar 8, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@imiskolee
Copy link

imiskolee commented Mar 8, 2018

in codegen/models_build.go:69

why not support recursive type define?

we need support it .

input is work.

input R {
 id:Int
items:[R]
}

type dont work.

type R {
 id:Int
items:[R]
}
@Teddy-Schmitz
Copy link

to add to this it looks like the code is generating the wrong pointer type when you have the situation above.

		case "OR":
			var err error
			var ptr1 filters.Catalog
			rawIf2 := v.([]interface{})
			ptr1 = make([]*filters.Catalog, len(rawIf2))
			for idx2 := range rawIf2 {
				var ptr3 filters.Catalog

				ptr3, err = UnmarshalCatalogFilter(rawIf2[idx2])
				ptr1[idx2] = &ptr3
			}
			it.OR = &ptr1
			if err != nil {
				return it, err
			}

var ptr1 should be a []*filters.Catalog

@vektah vektah added the bug Something isn't working label Mar 8, 2018
@vektah
Copy link
Collaborator

vektah commented Mar 17, 2018

I need more info for this, the code generated from those types look fine, perhaps a failing test case?

I think this might be a dupe of #44.

@Teddy-Schmitz I think you might have a different issue, that looks like arg unpacking (input) code, could you raise a bug with schema to reproduce it?

@vektah vektah closed this as completed Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants