Giter Site home page Giter Site logo

Comments (4)

vektah avatar vektah commented on August 15, 2024

Yeah I had a go here, still a long way off and I'm going to leave it for now and concentrate on integration gqlparser with gqlgen (in a branch).

One thing I noticed is those tests refer to Type, which doesn't exist in the schema so it will always be nil. I added it temporarily to get things passing

I've been making most of the visitors call at the end, so the walker never exposes unbound Definitions (if it can find them)

eg https://github.com/vektah/gqlparser/blob/master/validator/walk.go#L113 happens after all the childen have been walked, so any defs should be defined

As far as pointers I kinda agree, I've been moving away from them in a few places but I don't think its required here

You can still do

// use i here instead of `i, sel` otherwise you take a pointer to a copy.
for i := range field.SelectionSet {
	w.walkSelection(def, &field.SelectionSet[i])
}

func (w *Walker) walkSelection(parentDef *ast.Definition, it *ast.Selection) {
    // ...
}

to get a pointer to the element in the slice, the slice elements never change.

from gqlparser.

vvakame avatar vvakame commented on August 15, 2024

ah, sorry. I wrote type SelectionSet []*Selection but Selection is interface...
https://play.golang.org/p/Ud0TMZHTFbM
We can't use *ast.Selection I think...

One thing I noticed is those tests refer to Type

I found same things. f1, f2 and f3 is not exists in schemas... spec

from gqlparser.

vvakame avatar vvakame commented on August 15, 2024

https://play.golang.org/p/6_4HFmMhdlU 🤔

from gqlparser.

vektah avatar vektah commented on August 15, 2024

I'm not sure what your trying to do, https://gitter.im/gqlgen/parser?

from gqlparser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.