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

Directive invocation argument value is empty when it's an Input #87

Closed
greabock opened this issue Jan 14, 2018 · 3 comments
Closed

Directive invocation argument value is empty when it's an Input #87

greabock opened this issue Jan 14, 2018 · 3 comments

Comments

@greabock
Copy link
Member

greabock commented Jan 14, 2018

  • Compiler Version: 1.1.1
  • PHP Version: 7.1
  • Component: SDL

Description:

When we typing directive argument as an Input and then invoke this directive with argument correct struct value of passed argument of directive invocation is actualy empty object.

Steps To Reproduce:

Compile this:

directive @some(value: Bar) on OBJECT

input Bar {
   one: String!
   two: String
}

type Foo @some(value: {one: "Hey!"}){
    any: String!
}

then

$value = $document
    ->getTypeDefinition('Foo')
    ->getDirective('some')
    ->getPassedArgument('value')
;

var_dump($value);

Expected result:

Instance of InputInvocationBuilder filled with actual value ({one: "Hey!"}).

What happens instead?

Empty Instance of InputInvocationBuilder:

object(Railt\SDL\Reflection\Builder\Invocations\InputInvocationBuilder)#699 (0) {}
@greabock
Copy link
Member Author

Probably related with #86

@greabock greabock changed the title Directive invocation argument value is empty when it's an Object Directive invocation argument value is empty when it's an Input Jan 14, 2018
@SerafimArts
Copy link
Member

SerafimArts commented Jan 16, 2018

Probably related with #86

Nope. There were two problems:

  1. The problem is that the selection of types from the "future" stack (this is stack of invocable types) was not recursive (that is, if type A adds a type B to the stack during the build of dependencies - it does not build). In this connection, the meaning of the input (which is the Invocation) inside the directive (which is also an Invocation) is not compiled.
  2. In addition, the dependency graph between call and type definition during the resolves of this type was incorrectly built.

@SerafimArts
Copy link
Member

Fixed: 44caa07 2abc815 and 82f65e1

Will be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants