Skip to content

Commit

Permalink
Merge pull request #17 from oklahomer/feature/remove_fql_support
Browse files Browse the repository at this point in the history
Remove FQL support
  • Loading branch information
oklahomer committed Mar 26, 2017
2 parents 5c0b20d + 7add801 commit 67b9aab
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 103 deletions.
40 changes: 0 additions & 40 deletions README.md
Expand Up @@ -65,8 +65,6 @@ including:
- Acquiring user, app and/or page token and refreshing user token for
long lived one.
- Batch Request
- FQL
- FQL with Multi-Query
- Field Expansion
- Etag
- Wall Posting with Photo or Video
Expand Down Expand Up @@ -507,44 +505,6 @@ You can specify access token for each query within a single batch request.
See [https://developers.facebook.com/docs/graph-api/making-multiple-requests/](https://developers.facebook.com/docs/graph-api/making-multiple-requests/)
for detail.

### `$fb->fql($fql_query)`

Alias to `request()` that optimizes query parameter for FQL query and sends
`GET` request.

my $res = $fb->fql('SELECT display_name FROM application WHERE app_id = 12345');
#{
# data => [{
# display_name => 'app',
# }],
#}

### `$fb->bulk_fql(\%fql_queries)`

Alias to `fql()` to request multiple FQL query at once.

my $res = $fb->bulk_fql(+{
'all friends' => 'SELECT uid2 FROM friend WHERE uid1 = me()',
'my name' => 'SELECT name FROM user WHERE uid = me()',
});
#{
# data => [
# {
# fql_result_set => [
# {uid2 => 12345},
# {uid2 => 67890},
# ],
# name => 'all friends',
# },
# {
# fql_result_set => [
# name => 'Michael Corleone'
# ],
# name => 'my name',
# },
# ],
#}

### `$fb->delete($path, \%param)`

Alias to `request()` that sends DELETE request to delete object on Facebook's
Expand Down
58 changes: 0 additions & 58 deletions lib/Facebook/OpenGraph.pm
Expand Up @@ -392,22 +392,6 @@ sub batch_fast {
return \@responses;
}

# Facebook Query Language (FQL) Overview
# https://developers.facebook.com/docs/technical-guides/fql/
sub fql {
my $self = shift;
my $query = shift;
return $self->get('/fql', +{q => $query}, @_);
}

# Facebook Query Language (FQL) Overview: Multi-query
# https://developers.facebook.com/docs/technical-guides/fql/#multi
sub bulk_fql {
my $self = shift;
my $batch = shift;
return $self->fql($self->json->encode($batch), @_);
}

sub request {
my ($self, $method, $uri, $param_ref, $headers) = @_;

Expand Down Expand Up @@ -748,10 +732,6 @@ long lived one.
=item * Batch Request
=item * FQL
=item * FQL with Multi-Query
=item * Field Expansion
=item * Etag
Expand Down Expand Up @@ -1212,44 +1192,6 @@ You can specify access token for each query within a single batch request.
See L<https://developers.facebook.com/docs/graph-api/making-multiple-requests/>
for detail.
=head3 C<< $fb->fql($fql_query) >>
Alias to C<request()> that optimizes query parameter for FQL query and sends
C<GET> request.
my $res = $fb->fql('SELECT display_name FROM application WHERE app_id = 12345');
#{
# data => [{
# display_name => 'app',
# }],
#}
=head3 C<< $fb->bulk_fql(\%fql_queries) >>
Alias to C<fql()> to request multiple FQL query at once.
my $res = $fb->bulk_fql(+{
'all friends' => 'SELECT uid2 FROM friend WHERE uid1 = me()',
'my name' => 'SELECT name FROM user WHERE uid = me()',
});
#{
# data => [
# {
# fql_result_set => [
# {uid2 => 12345},
# {uid2 => 67890},
# ],
# name => 'all friends',
# },
# {
# fql_result_set => [
# name => 'Michael Corleone'
# ],
# name => 'my name',
# },
# ],
#}
=head3 C<< $fb->delete($path, \%param) >>
Alias to C<request()> that sends DELETE request to delete object on Facebook's
Expand Down
7 changes: 4 additions & 3 deletions t/002_retrieve/08_fql.t
Expand Up @@ -6,6 +6,8 @@ use URI;
use JSON 2 qw/encode_json/;
use Facebook::OpenGraph;

plan skip_all => "FQL is no longer supported by Graph API";

subtest 'user' => sub {

my $app_id = 127497087322461;
Expand All @@ -30,7 +32,7 @@ subtest 'user' => sub {
},
'args'
);

return (
1,
200,
Expand All @@ -47,9 +49,8 @@ subtest 'user' => sub {

my $fb = Facebook::OpenGraph->new;
my $res = $fb->fql($query);

is_deeply $res->{data}, [$datum_ref], 'data';

};

done_testing;
6 changes: 4 additions & 2 deletions t/002_retrieve/09_bulk_fql.t
Expand Up @@ -5,6 +5,8 @@ use Test::Mock::Furl;
use JSON 2 qw(decode_json encode_json);
use Facebook::OpenGraph;

plan skip_all => "FQL is no longer supported by Graph API";

subtest 'multi query w/out dependencies' => sub {

my $val = [
Expand Down Expand Up @@ -44,7 +46,7 @@ subtest 'multi query w/out dependencies' => sub {
is_deeply $args{headers}, [], 'no particular header';
is $args{content}, '', 'content';
is $args{method}, 'GET', 'HTTP GET method';

my $uri = $args{url};
is $uri->scheme, 'https', 'scheme';
is $uri->path, '/fql', 'path';
Expand All @@ -57,7 +59,7 @@ subtest 'multi query w/out dependencies' => sub {
},
'query parameter',
);

return (
1,
200,
Expand Down

0 comments on commit 67b9aab

Please sign in to comment.