public override string CollectTypes(TypeCollectionContext context)
        {
            if (!string.IsNullOrWhiteSpace(_remoteLocation) && !string.IsNullOrWhiteSpace(_name))
            {
                // get remote server information
                // if we haven't fetched the remote types for this remote:
                if (!RemoteServerSchemas.TryGetValue(_remoteLocation, out var schema))
                {
                    throw new Exception($"Schema not already loaded for remote {_remoteLocation}");
                }

                // get type
                if (!TryGetFieldTypeFromRemoteSchema(schema, _name, out var type))
                {
                    // if no type found: fail
                    // TODO: fail better
                    throw new Exception($"Failed to find type '{_name}' in remote '{_remoteLocation}' schema");
                }

                Name = $"{_remoteLocation}.{_name}";

                if (!_hasAddedFields)
                {
                    var fields = GetFieldsForFieldType(_remoteLocation, type).Where(f => f != null).ToList();
                    foreach (var field in fields)
                    {
                        AddField(field);
                    }

                    _hasAddedFields = true;
                }
            }

            return(base.CollectTypes(context));
        }
        private static Introspection.Schema FetchRemoteServerSchema(string remote, RemoteSchemaFetcher remoteSchemaFetcher)
        {
            // lock types mutex
            lock (FetchRemoteServerSchemaMutex)
            {
                // did someone else fetch it while we were waiting?
                if (!RemoteServerSchemas.TryGetValue(remote, out var schema))
                {
                    //  fetch remote type information
                    if (!TryGetRemoteSchema(remote, remoteSchemaFetcher, out schema))
                    {
                        // if it fails: fail
                        // TODO: fail better
                        throw new Exception("Failed to get remote schema");
                    }

                    // if it succeeds: save type information for all types
                    RemoteServerSchemas.AddOrUpdate(remote, schema, (key, old) => schema);
                }

                return(schema);
            }
        }