Example #1
0
        public bool IsSupportedMutation(string nodeName, NodeMutationType mutation)
        {
            string mutationPrefix = string.Empty;

            switch (mutation)
            {
            case NodeMutationType.Create:
                mutationPrefix = "Create";
                break;

            case NodeMutationType.Update:
                mutationPrefix = "Update";
                break;

            case NodeMutationType.Delete:
                mutationPrefix = "Delete";
                break;
            }
            var mutationName = mutationPrefix + nodeName;

            if (_schemaCache == null)
            {
                _schemaCache = GetSchema();
            }
            var mutationField = _schemaCache.GetMutations(nodeName).FirstOrDefault(m => m.Name == mutationName);

            return(mutationField != null);
        }