我正在查看Graphql变异源代码,我看到了这段代码,我不知道该搜索什么,我在下面看到<T>
和 type mutationFn = (
object: any,
ctx: any,
info: GraphQLResolveInfo
) => Promise<any> | any;
function resolveMaybeThunk<T>(thingOrThunk: Thunk<T>): T {
return typeof thingOrThunk === 'function' ? thingOrThunk() : thingOrThunk;
}
type MutationConfig = {
name: string,
description?: string,
deprecationReason?: string,
inputFields: Thunk<GraphQLInputFieldConfigMap>,
outputFields: Thunk<GraphQLFieldConfigMap<*, *>>,
mutateAndGetPayload: mutationFn,
};
,这是什么?
<code>
使用import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.util.ArrayList;
public class Menu1 extends Fragment {
private ArrayList<Property> rentalProperties = new ArrayList<>();
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//returning our layout file
//change R.layout.yourlayoutfilename for each of your fragments
return inflater.inflate(R.layout.fragment_all, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
//you can set the title for your toolbar here for different fragments different titles
getActivity().setTitle("All");
//create property elements
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_all);
//create our property elements
rentalProperties.add(new Property(10, "Smith Street", "Sydney", "NSW", "A large 3 bedroom apartment right in the heart of Sydney! A rare find, with 3 bedrooms and a secured car park.", 450.00, "property_image_1", 3, 1, 1, false));
rentalProperties.add(new Property(66, "King Street", "Sydney", "NSW", "A fully furnished studio apartment overlooking the harbour. Minutes from the CBD and next to transport, this is a perfect set-up for city living.", 320.00, "property_image_2", 1, 1, 1, false));
rentalProperties.add(new Property(1, "Liverpool Road", "Liverpool", "NSW", "A standard 3 bedroom house in the suburbs. With room for several cars and right next to shops this is perfect for new families.", 360.00, "property_image_3", 3, 2, 2, true));
rentalProperties.add(new Property(567, "Sunny Street", "Gold Coast", "QLD", "Come and see this amazing studio apartment in the heart of the gold coast, featuring stunning waterfront views.", 360.00, "property_image_4" , 1, 1, 1, false));
//create our new array adapter
ArrayAdapter<Property> adapter = new propertyArrayAdapter(this, 0, rentalProperties);
//Find list view and bind it with the custom adapter
ListView listView = (ListView) findViewById(R.id.customListView);
listView.setAdapter(adapter);
//add event listener so we can handle clicks
AdapterView.OnItemClickListener adapterViewListener = new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Property property = rentalProperties.get(position);
Intent intent = new Intent(Menu1.this, DetailActivity.class);
intent.putExtra("streetNumber", property.getStreetNumber());
intent.putExtra("streetName", property.getStreetName());
intent.putExtra("suburb", property.getSuburb());
intent.putExtra("state", property.getState());
intent.putExtra("image", property.getImage());
startActivityForResult(intent, 1000);
}
};
//set the listener to the list view
listView.setOnItemClickListener(adapterViewListener);
}
}
包裹代码时该怎么办?