Deprecate value in favor of constant; valueorvariable -> input value
This commit is contained in:
parent
c2b48ad39e
commit
225a83078b
4 changed files with 27 additions and 21 deletions
11
graphql_parser/lib/src/language/ast/constant.dart
Normal file
11
graphql_parser/lib/src/language/ast/constant.dart
Normal file
|
@ -0,0 +1,11 @@
|
|||
import 'node.dart';
|
||||
|
||||
abstract class ConstantContext<T> extends Node {
|
||||
T get value;
|
||||
}
|
||||
|
||||
/// Use [ConstantContext] instead. This class remains solely for backwards compatibility.
|
||||
@deprecated
|
||||
abstract class ValueContext<T> extends ConstantContext<T> {
|
||||
T get value;
|
||||
}
|
16
graphql_parser/lib/src/language/ast/input_value.dart
Normal file
16
graphql_parser/lib/src/language/ast/input_value.dart
Normal file
|
@ -0,0 +1,16 @@
|
|||
import 'package:source_span/source_span.dart';
|
||||
import 'constant.dart';
|
||||
import 'node.dart';
|
||||
import 'variable.dart';
|
||||
|
||||
class InputValueContext extends Node {
|
||||
final ConstantContext constant;
|
||||
final VariableContext variable;
|
||||
|
||||
InputValueContext(this.constant, this.variable) {
|
||||
assert(constant != null || variable != null);
|
||||
}
|
||||
|
||||
@override
|
||||
FileSpan get span => constant?.span ?? variable.span;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
import 'node.dart';
|
||||
|
||||
abstract class ValueContext<T> extends Node {
|
||||
T get value;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
import 'node.dart';
|
||||
import 'package:source_span/source_span.dart';
|
||||
import 'value.dart';
|
||||
import 'variable.dart';
|
||||
|
||||
class ValueOrVariableContext extends Node {
|
||||
final ValueContext value;
|
||||
final VariableContext variable;
|
||||
|
||||
ValueOrVariableContext(this.value, this.variable) {
|
||||
assert(value != null || variable != null);
|
||||
}
|
||||
|
||||
@override
|
||||
FileSpan get span => value?.span ?? variable.span;
|
||||
}
|
Loading…
Reference in a new issue