Beispiel #1
0
        public static async Task RunAsync()
        {
            await using var stream = JsonStreamFactory.CreateGraphQlResponseStream();

            var parser = new LowLevelGraphQlResponseParser();

            var user = parser.ParseResponseJsonWithoutPipeReader(stream);
        }
        public void Setup()
        {
            _midLevelParser = new GraphQlResponseParser();
            _lowLevelParser = new LowLevelGraphQlResponseParser();
            _stream         = JsonStreamFactory.CreateGraphQlResponseStream();
            _emptyStream    = JsonStreamFactory.CreateEmptyGraphQlResponseStream();

            // needed for benchmarking to avoid stream closure
            // passed in as argument since under normal use we won't need to allocate this and can allow the stream to close
            _streamPipeReaderOptions = new StreamPipeReaderOptions(leaveOpen: true);
        }