Git Product home page Git Product logo

ferry_graphql_client_demo's People

Contributors

graphicbeacon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ferry_graphql_client_demo's Issues

Access Denied

After I ran the command [get-graphql-schema ENDPOINT_URL > lib/schema.graphql
] //With my end point url
This happens even on playground

I get this >>>

IMG_20210410_103203_153

flutter pub run build_runner build generates missing files and files that contain errors

Hello @graphicbeacon , I followed your Graphql / flutter tutorial using my own GraphQL API , the pub run build_runner build command takes forever and it won't stop running until I hit ctr+c , also it generates files that contain errors due to some missing files ,
What seems to be the problem? I would appreciate some help thank you in advance.

// GENERATED CODE - DO NOT MODIFY BY HAND

import 'package:built_collection/built_collection.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'package:gql_code_builder/src/serializers/default_scalar_serializer.dart'
    as _i1;

part 'schema.schema.gql.g.dart';

abstract class GDate implements Built<GDate, GDateBuilder> {
  GDate._();

  factory GDate([String value]) =>
      _$GDate((b) => value != null ? (b..value = value) : b);

  String get value;
  @BuiltValueSerializer(custom: true)
  static Serializer<GDate> get serializer => _i1.DefaultScalarSerializer<GDate>(
      (Object serialized) => GDate(serialized));
}

class GEntriesTimeSheet extends EnumClass {
  const GEntriesTimeSheet._(String name) : super(name);

  static const GEntriesTimeSheet FULLDAY = _$gEntriesTimeSheetFULLDAY;

  static const GEntriesTimeSheet HALFDAY = _$gEntriesTimeSheetHALFDAY;

  static const GEntriesTimeSheet HALFDAYHALFHOLIDAY =
      _$gEntriesTimeSheetHALFDAYHALFHOLIDAY;

  static const GEntriesTimeSheet NOWORK = _$gEntriesTimeSheetNOWORK;

  static const GEntriesTimeSheet OFF = _$gEntriesTimeSheetOFF;

  static Serializer<GEntriesTimeSheet> get serializer =>
      _$gEntriesTimeSheetSerializer;
  static BuiltSet<GEntriesTimeSheet> get values => _$gEntriesTimeSheetValues;
  static GEntriesTimeSheet valueOf(String name) =>
      _$gEntriesTimeSheetValueOf(name);
}










when I first run it it only generates this file which contain tons of errors, this the stack that I get in the terminal when I run the command:

[WARNING] Deleted previous snapshot due to missing asset graph.
[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 10.9s

[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 999ms

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Running build...
[WARNING] gql_build:serializer_builder on lib/$lib$:
Your current `analyzer` version may not fully support your current SDK version.

Please try upgrading to the latest `analyzer` by running `flutter packages upgrade`.

Analyzer language version: 2.10.0
SDK language version: 2.13.0

If you are getting this message and have the latest analyzer please file
an issue at https://github.com/dart-lang/sdk/issues/new with the title
"No published analyzer available for language version 2.13.0".
Please search the issue tracker first and thumbs up and/or subscribe to
existing issues if present to avoid duplicates.






uilder issue, OperationResponse Optional, but why?

I do have an issue which I do not understand:

@override
Widget build(BuildContext context) {
  return MaterialApp(
    title: 'Flutter Demo',
    theme: ThemeData(
      primarySwatch: Colors.blue,
    ),
    home: Scaffold(
      appBar: AppBar(
        title: Text('World Nations'),
      ),
      body: Operation(
        client: client,
        operationRequest: playStoriesReq,
        builder: (
          BuildContext context,
          OperationResponse<GPlayStoriesData, GPlayStoriesVars> response,
          Object error,
        ) {
          if (response.loading) {
            return Center(child: CircularProgressIndicator());
          }
  
          final stories = response.data!.playStories;
  
          return ListView.builder(
            itemCount: stories.length,
            itemBuilder: (context, index) => ListTile(
              leading: Text('   ' + stories[index].id),
              title: Text(stories[index].title),
              subtitle: Text(stories[index].statement),
            ),
          );
        },
      ),
    ),
  );
}

I Do always get following issue on the builder:

The argument type 'Widget Function(BuildContext, OperationResponse<GPlayStoriesData, GPlayStoriesVars>, Object)' can't be assigned to the parameter type 'Widget Function(BuildContext, OperationResponse<GPlayStoriesData, GPlayStoriesVars>?, Object?)'.dartargument_type_not_assignable
{required Widget Function(BuildContext, OperationResponse<GPlayStoriesData, GPlayStoriesVars>?, Object?) builder}

My query looks like that:

query PlayStories {
  playStories {
    title
    id
    statement
    solution
    context
    newsOrFake
    sources {
      url
      title
      sort
      publisher
      logo
      image
      id
    }
  }
}

And in the schema the result is required:

type Query {
  playStories: [PlayStory!]!
}

What am I doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.