コード例 #1
0
        public GraphType FindType(string name)
        {
            if (_lookup == null)
            {
                _lookup = new GraphTypesLookup();
                CollectTypes(Query, _lookup);
                CollectTypes(Mutation, _lookup);
            }

            return(_lookup[name]);
        }
コード例 #2
0
        private void CollectTypes(GraphType type, GraphTypesLookup lookup)
        {
            if (type == null)
            {
                return;
            }

            lookup[type.Name] = type;

            type.Fields.Apply(field =>
            {
                CollectTypes(field.Type, lookup);
            });
        }